Enterprise Integration Zone is brought to you in partnership with:

Bosanac Dejan is a Senior Software Engineer at FuseSource specializing in messaging and integration with Apache ActiveMQ Dejan is a DZone MVB and is not an employee of DZone and has posted 16 posts at DZone. You can read more from them at their website. View Full User Profile

Wire Format Negotiation Timeout and LOG4J JMS Appender FAQs

09.16.2012
| 3804 views |
  • submit to reddit

Some folks have experienced problems with wire format negotiation timeouts. This can be due to overloaded brokers or lousy networks, but misconfiguration of the log4j jms appender could also be one of the causes. So, I wrote two FAQ entries that cover this topic:

Using log4j appender with ActiveMQ

Wire format negotiation timeout exception

Published at DZone with permission of Dejan Bosanac, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Ayemi Musa replied on Thu, 2014/06/12 - 10:18am

I came across this very issue (JMSException: Wire format negotiation timeout: peer did not send his wire format) when configuring JMSAppenders for log4j. 

I tried different solutions including your recommendations in this article but to no avail. Here is my settings.

log4j.properties

log4j.rootLogger = DEBUG, stdout, jmslog4j.logger.org.apache.activemq = DEBUG, stdoutlog4j.appender.stdout = org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout = org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern = %d %-5p %c - %m%nlog4j.appender.jms = org.apache.log4j.net.JMSAppenderlog4j.appender.jms.InitialContextFactoryName = org.apache.activemq.jndi.ActiveMQInitialContextFactorylog4j.appender.jms.ProviderURL = tcp://localhost:61616#?wireFormat.maxInactivityDurationInitalDelay=60000&keepAlive=truelog4j.appender.jms.TopicBindingName = logTopiclog4j.appender.jms.TopicConnectionFactoryBindingName = ConnectionFactory


jndi.properties

topic.logTopic = logTopic


Error message:

log4j: Reading configuration from URL file:C:/Users/musay01/MuleStudio/workspace/.mule/apps/jms-appender-poc/classes/log4j.propertieslog4j: Parsing for [root] with value=[DEBUG, stdout, jms].log4j: Level token is [DEBUG].log4j: Category root set to DEBUGlog4j: Parsing appender named "stdout".log4j: Parsing layout options for "stdout".log4j: Setting property [conversionPattern] to [%d %-5p %c - %m%n].log4j: End of parsing for "stdout".log4j: Parsed "stdout" options.log4j: Parsing appender named "jms".log4j: Setting property [initialContextFactoryName] to [org.apache.activemq.jndi.ActiveMQInitialContextFactory].log4j: Setting property [topicBindingName] to [logTopic].log4j: Setting property [topicConnectionFactoryBindingName] to [ConnectionFactory].log4j: Setting property [providerURL] to [tcp://localhost:61616].log4j: Getting initial context.log4j: Looking up [ConnectionFactory]log4j: About to create TopicConnection.2014-06-12 10:14:52,712 DEBUG org.apache.activemq.transport.WireFormatNegotiator - Sending: WireFormatInfo { version=9, properties={MaxFrameSize=9223372036854775807, CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}log4j: Creating TopicSession, non-transactional, in AUTO_ACKNOWLEDGE mode.log4j:ERROR Error while activating options for appender named [jms].javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1395)at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1481)at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:323)at org.apache.activemq.ActiveMQConnection.createTopicSession(ActiveMQConnection.java:1112)at org.apache.log4j.net.JMSAppender.activateOptions(JMSAppender.java:218)at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)at org.apache.log4j.Logger.getLogger(Logger.java:117)at org.mule.module.logging.LoggerReferenceHandler.<init>(LoggerReferenceHandler.java:28)at org.mule.module.logging.MuleLogFactory.<init>(MuleLogFactory.java:41)at org.apache.commons.logging.LogFactory.<clinit>(LogFactory.java:32)at org.mule.module.launcher.CompositeDeploymentListener.<init>(CompositeDeploymentListener.java:24)at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:108)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.