There's a difference between persisting a JBI exchange and a JMS message.
ActiveMQ is a JMS broker and persist the message if it has been configured
to do so (this is done when sending the message).  For JBI exchange, each
message can have a "persistent" flag (with default values on the
ActivationSpec and on the container).  If the flag is true, then the NMR
will select a flow that can handle persistent message: i.e. the jms flow.
The thing is that the JMS flow can also be used for remoting, so that
message won't be persistent by default iirc.
Just try the following:

   <smx:container persistent="true" ...>

and all messages will be persistent.

On Nov 26, 2007 9:50 AM, Andrea Zoppello <[EMAIL PROTECTED]> wrote:

> Hi Guillaume,
>
> Thanks for the response.
>
> BTW In my previous post i've say something wrong.
>
> If i configure the activemq persistence like:
>
> <amq:persistenceAdapter>
>     <amq:jdbcPersistenceAdapter dataSource="#derby-ds"/>
> </amq:persistenceAdapter>
>
>
> and then after running some processes, i stop smx and i look to
> derby database i don't find any message in the queue.
>
> I think this was enough, but it seems i was missing something.
>
> The solution to register a custom listener enabling the persistence by
> setting the property
> on the message seems to fit my need, so i think i'll adopt this solution.
>
> Btw, if i really understand well, it seems that i can enable persistence
> of only * Lightweigth
> Endpoint* is this right?
>
> If i want to persist all messages, which is the right way to configure
> persistence on the
> broker.
>
> Andrea Zoppello
>
> Guillaume Nodet ha scritto:
> > On Nov 22, 2007 4:41 PM, Andrea Zoppello <[EMAIL PROTECTED]> wrote:
> >
> >
> >> Hi all,
> >>
> >> I'm trying to configure servicemix to use the activemq persistence of
> >> message so i add this:
> >> configuration:
> >>
> >> <amq:persistenceAdapter>
> >>      <amq:jdbcPersistenceAdapter dataSource="#derby-ds"/>
> >> </amq:persistenceAdapter>
> >>
> >> This seems to work.
> >>
> >> BTW I've two question:
> >>
> >> 1) In smx there's a queue for each jbi endpoint. The question is if
> i've
> >> a sa composed of three
> >> endpoint Ep1->Ep2->Ep3 it's possible to make persistent only the
> message
> >> of the queue related to EP1 ?
> >>
> >
> >
> > Persistence is defined on a per message level, but it's kinda hard to
> > configure.
> > The NMR will check if persistence is enabled at three different levels:
> on
> > the message  by looking for a given property on the exchange (
> > org.apache.servicemix.persistent), on the endpoint by looking at the
> > corresponding activationSpec (so it does not really fit well with non
> > lightweight components) and on the broker.  I suppose the way you could
> > change that is by registering a listener on the container, filter the
> > exchanges you want and put the property on it.
> >
> >
> >
> >> 2) I try the configuration with mysql database and smx 3.1.2 but this
> is
> >> not working. I set the log level
> >> to debug and it seems that smx is blocked trying to aquire a lock on
> the
> >> database. This cause smx not to start.
> >> Any suggestion about this.
> >>
> >
> >
> > You should try with the default ActiveMQ distribution and / or ask on
> the
> > activemq user list.
> >
> >
> >
> >> Andrea Zoppello
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Reply via email to