camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From selezovikj <semir.elezo...@gmail.com>
Subject Re: Log4j JMS appender - failover
Date Thu, 16 Oct 2008 11:33:42 GMT

You are right. 
However, what I get is: 
org.apache.activemq.transport.failover.FailoverTransport DEBUG  - Waking up
reconnect task
org.apache.activemq.transport.failover.FailoverTransport DEBUG  - Attempting
connect to: tcp://localhost:61617

And it does not connect. 

I have another question. In my jndi.properties file I have the following
information: 

java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
java.naming.provider.url =
failover://(tcp://localhost:61617,tcp://localhost:61616)?randomize=false
topic.LoggingTopic = LoggingTopic

Then in the log4j.properties my JMS appender is like this: 

log4j.appender.jms=org.apache.log4j.net.JMSAppender
log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
log4j.appender.jms.ProviderURL=failover://(tcp://localhost:61617,tcp://localhost:61616)?randomize=false
log4j.appender.jms.TopicBindingName=LoggingTopic
log4j.appender.jms.topicConnectionFactoryBindingName=ConnectionFactory
log4j.appender.jms.layout=org.apache.log4j.PatternLayout
log4j.appender.jms.layout.ConversionPattern=%d#%c{1}#STATS#%x%m%n
------------------------------------------------------------------------------------------------------------------

WHY should I specify the initialContextFactoryName again, the providerURL
again ? 




James.Strachan wrote:
> 
> 2008/10/16 selezovikj <semir.elezovic@gmail.com>:
>>
>> I want to be logging to a primary host, and in case it fails to a
>> secondary
>> host.
>> However log4j does not support the failover keyword.
>>
>> log4j.appender.jms.ProviderURL=failover:(tcp://localhost:61617,
>> tcp://localhost:61616)?randomize=false
>>
>> It complains in the following way:
>>
>> log4j:ERROR Error while activating options for appender named [jms].
>> javax.naming.NamingException: Invalid broker URL
>>        at
>> org.apache.activemq.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContextFactory.java:67)
>>        at
>> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> 
> This exception looks like its nothing to do with that setting - it
> looks to be an issue creating the initial JNDI context (in the JNDI
> properties file)
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Log4j-JMS-appender---failover-tp20010627s22882p20011788.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message