Konnte nicht aktualisieren JMS-Verbindungs-Ziel 'jmsinqueue' - Wiederholung in 5000 ms
Ziel zu verbinden Hornteq und senden eine Nachricht zu einer queue und die route, die es zu einem Thema oder Warteschlange und sehen Sie die Inhalte in die Warteschlange und Thema nach routing und routing vor
aber bin immer der Fehler :
Could not refresh JMS Connection for destination 'jmsinqueue' - retrying in 5000 ms. Cause: Failed to create session factory; nested exception is java.lang.IllegalStateException: The following keys are invalid for configuring a connector: http-upgrade-endpoint
Unten ist die Beschreibung ein-und Ausgabe des Programms.
2 Frage :Wie kann ich die Java-DSL wie ich haben verwendet, im Kontext-xml und senden eine Warteschlange, in der hornetq-route es mit Kamel-Prozess und Weg zu einem Ausgabe-Warteschlange .Ich habe die Forschung getan, aber ich bin noch ein Neuling auf diesem Ihre Beratung und Hilfe wird sehr geschätzt...
daher werde ich in der Lage sein zu verwenden, apache camel, für alle die integration mit hornetq und nicht activemq.
Bin mit einer jndi-Verbindung zu kommunizieren, zu wildFly und im Kontext-xml habe ich Folgendes
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory</prop>
<prop key="java.naming.provider.url">http-remoting://localhost:8080</prop>
<prop key="java.naming.security.principal">testuser</prop>
<prop key="java.naming.security.credentials">password</prop>
</props>
</property>
</bean>
<bean id="jmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="jndiName">
<value>java:jms/RemoteConnectionFactory</value>
</property>
</bean>
<bean name="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsQueueConnectionFactory"/>
</bean>
<bean id="mylogger" class="org.apache.camel.component.log.LogComponent"/>
<bean id="logMessageOnTimerEvent"
class="com.naistech.camelhornetq.LogMessageOnTimerEventRouteBuilder"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<routeBuilder ref="logMessageOnTimerEvent"/>
</camelContext>
<camel:camelContext id="context1">
<camel:route id="FirstRoute">
<!-- <camel:from uri="jms:queue:inputqueue"/>-->
<camel:from uri="jms:queue:jmsinqueue"/>
<camel:log logName="jmsLog" message="Got message from JMS queue:"/>
<camel:to uri="jms:topic:helloworld"/>
</camel:route>
</camel:camelContext>
</beans>
Ist und ich dann erstellen Sie die Warteschlangen und Themen mithilfe der jboss-cli :
wenn ich das Programm starte, die
Hinweis: ich verließ die Importe
public class SpringJavaDslApplication extends RouteBuilder {
public static void main(String[] args) throws InterruptedException, Exception {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("META-INF/spring/camel-context.xml");
applicationContext.start();
//let the Camel runtime do its job for 5 seconds
Thread.sleep(5000);
//----------------------------------------------------------------------
SimpleRegistry registry = new SimpleRegistry();
//add POJOs to the registry here using registry.put("name", <object reference>)
CamelContext context = new DefaultCamelContext(registry);
context.addComponent("mylogger", new LogComponent());
context.addRoutes(new LogMessageOnTimerEventRouteBuilder());
context.start();
//let the Camel runtime do its job for 5 seconds
Thread.sleep(5000);
//shutdown
context.stop();
//----------------------------------------------------------------------
//shutdown
applicationContext.stop();
}
public void configure() throws Exception {
from("jms:queue:someQueue")
.to("jms:queue:someOtherQueue");
}
}
bekomme ich die folgende Ausgabe in der Konsole
--- exec-maven-plugin:1.2.1:exec (default-cli) @ camelHornetq-wildfly ---
2014-02-28 14:28:15,196 [main ] INFO ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6d4b8027: startup date [Fri Feb 28 14:28:15 EAT 2014]; root of context hierarchy
2014-02-28 14:28:15,243 [main ] INFO XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/camel-context.xml]
2014-02-28 14:28:16,441 [main ] INFO DefaultListableBeanFactory - Overriding bean definition for bean 'template': replacing [Generic bean: class [org.apache.camel.spring.CamelProducerTemplateFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.apache.camel.spring.CamelProducerTemplateFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2014-02-28 14:28:16,441 [main ] INFO DefaultListableBeanFactory - Overriding bean definition for bean 'consumerTemplate': replacing [Generic bean: class [org.apache.camel.spring.CamelConsumerTemplateFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.apache.camel.spring.CamelConsumerTemplateFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
2014-02-28 14:28:16,518 [main ] INFO DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@35c5acda: defining beans [jndiTemplate,jmsQueueConnectionFactory,jms,mylogger,logMessageOnTimerEvent,camel-1:beanPostProcessor,camel-1,context1:beanPostProcessor,context1]; root of factory hierarchy
2014-02-28 14:28:16,606 [main ] INFO xnio - XNIO version 3.2.0.Final
2014-02-28 14:28:16,671 [main ] INFO nio - XNIO NIO Implementation Version 3.2.0.Final
2014-02-28 14:28:16,741 [main ] INFO remoting - JBoss Remoting version 4.0.0.Final
2014-02-28 14:28:17,131 [ndpoint" task-6] ERROR RemoteNamingStoreV1 - Channel end notification received, closing channel Channel ID e2358a57 (outbound) of Remoting connection 550661b8 to localhost/127.0.0.1:8080
2014-02-28 14:28:17,592 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: camel-1) is starting
2014-02-28 14:28:17,593 [main ] INFO ManagedManagementStrategy - JMX is enabled
2014-02-28 14:28:17,717 [main ] INFO DefaultTypeConverter - Loaded 176 type converters
2014-02-28 14:28:17,888 [main ] INFO SpringCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2014-02-28 14:28:17,937 [main ] INFO SpringCamelContext - Route: route1 started and consuming from: Endpoint[timer://logMessageTimer?period=1s]
2014-02-28 14:28:17,949 [main ] INFO SpringCamelContext - Total 1 routes, of which 1 is started.
2014-02-28 14:28:17,954 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: camel-1) started in 0.359 seconds
2014-02-28 14:28:17,958 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: context1) is starting
2014-02-28 14:28:17,958 [main ] INFO ManagedManagementStrategy - JMX is enabled
2014-02-28 14:28:17,979 [main ] INFO DefaultTypeConverter - Loaded 176 type converters
2014-02-28 14:28:18,039 [main ] INFO SpringCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2014-02-28 14:28:18,103 [main ] INFO SpringCamelContext - Route: FirstRoute started and consuming from: Endpoint[jms://queue:jmsinqueue]
2014-02-28 14:28:18,111 [main ] INFO SpringCamelContext - Total 1 routes, of which 1 is started.
2014-02-28 14:28:18,112 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: context1) started in 0.153 seconds
2014-02-28 14:28:18,973 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-1, firedTime=Fri Feb 28 14:28:18 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:18,993 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:18 EAT 2014
2014-02-28 14:28:19,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-3, firedTime=Fri Feb 28 14:28:19 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:19,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:19 EAT 2014
2014-02-28 14:28:20,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-5, firedTime=Fri Feb 28 14:28:20 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:20,938 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:20 EAT 2014
2014-02-28 14:28:21,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-7, firedTime=Fri Feb 28 14:28:21 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:21,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:21 EAT 2014
2014-02-28 14:28:22,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-9, firedTime=Fri Feb 28 14:28:22 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:22,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:22 EAT 2014
2014-02-28 14:28:23,116 [mer[jmsinqueue]] INFO ultJmsMessageListenerContainer - JMS message listener invoker needs to establish shared Connection
2014-02-28 14:28:23,116 [main ] INFO DefaultCamelContext - Apache Camel 2.12.2 (CamelContext: camel-4) is starting
2014-02-28 14:28:23,116 [main ] INFO ManagedManagementStrategy - JMX is enabled
2014-02-28 14:28:23,117 [mer[jmsinqueue]] ERROR ultJmsMessageListenerContainer - Could not refresh JMS Connection for destination 'jmsinqueue' - retrying in 5000 ms. Cause: Failed to create session factory; nested exception is java.lang.IllegalStateException: The following keys are invalid for configuring a connector: http-upgrade-endpoint
2014-02-28 14:28:23,343 [main ] INFO DefaultTypeConverter - Loaded 176 type converters
2014-02-28 14:28:23,374 [main ] INFO DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2014-02-28 14:28:23,399 [main ] INFO DefaultCamelContext - Route: route2 started and consuming from: Endpoint[timer://logMessageTimer?period=1s]
2014-02-28 14:28:23,403 [main ] INFO DefaultCamelContext - Total 1 routes, of which 1 is started.
2014-02-28 14:28:23,403 [main ] INFO DefaultCamelContext - Apache Camel 2.12.2 (CamelContext: camel-4) started in 0.287 seconds
2014-02-28 14:28:23,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-11, firedTime=Fri Feb 28 14:28:23 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:23,938 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:23 EAT 2014
2014-02-28 14:28:24,399 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-2-1, firedTime=Fri Feb 28 14:28:24 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:24,400 [logMessageTimer] INFO route2 - Event triggered by logMessageTimer at Fri Feb 28 14:28:24 EAT 2014
2014-02-28 14:28:24,936 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-13, firedTime=Fri Feb 28 14:28:24 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:24,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:24 EAT 2014
2014-02-28 14:28:25,399 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-2-3, firedTime=Fri Feb 28 14:28:25 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:25,400 [logMessageTimer] INFO route2 - Event triggered by logMessageTimer at Fri Feb 28 14:28:25 EAT 2014
2014-02-28 14:28:25,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-15, firedTime=Fri Feb 28 14:28:25 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:25,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:25 EAT 2014
2014-02-28 14:28:26,399 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-2-5, firedTime=Fri Feb 28 14:28:26 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:26,400 [logMessageTimer] INFO route2 - Event triggered by logMessageTimer at Fri Feb 28 14:28:26 EAT 2014
2014-02-28 14:28:26,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-17, firedTime=Fri Feb 28 14:28:26 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:26,937 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:26 EAT 2014
2014-02-28 14:28:27,400 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-2-7, firedTime=Fri Feb 28 14:28:27 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:27,400 [logMessageTimer] INFO route2 - Event triggered by logMessageTimer at Fri Feb 28 14:28:27 EAT 2014
2014-02-28 14:28:27,937 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-0-19, firedTime=Fri Feb 28 14:28:27 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:27,938 [logMessageTimer] INFO route1 - Event triggered by logMessageTimer at Fri Feb 28 14:28:27 EAT 2014
2014-02-28 14:28:28,118 [mer[jmsinqueue]] ERROR ultJmsMessageListenerContainer - Could not refresh JMS Connection for destination 'jmsinqueue' - retrying in 5000 ms. Cause: Failed to create session factory; nested exception is java.lang.IllegalStateException: The following keys are invalid for configuring a connector: http-upgrade-endpoint
2014-02-28 14:28:28,400 [logMessageTimer] INFO insideTheRoute - Exchange[ExchangePattern: InOnly, Headers: {breadcrumbId=ID-naistech-53400-1393586897419-2-9, firedTime=Fri Feb 28 14:28:28 EAT 2014}, BodyType: null, Body: [Body is null]]
2014-02-28 14:28:28,400 [logMessageTimer] INFO route2 - Event triggered by logMessageTimer at Fri Feb 28 14:28:28 EAT 2014
2014-02-28 14:28:28,403 [main ] INFO DefaultCamelContext - Apache Camel 2.12.2 (CamelContext: camel-4) is shutting down
2014-02-28 14:28:28,404 [main ] INFO DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 300 seconds)
2014-02-28 14:28:28,407 [ - ShutdownTask] INFO DefaultShutdownStrategy - Route: route2 shutdown complete, was consuming from: Endpoint[timer://logMessageTimer?period=1s]
2014-02-28 14:28:28,407 [main ] INFO DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
2014-02-28 14:28:28,412 [main ] INFO DefaultCamelContext - Apache Camel 2.12.2 (CamelContext: camel-4) uptime 5.295 seconds
2014-02-28 14:28:28,412 [main ] INFO DefaultCamelContext - Apache Camel 2.12.2 (CamelContext: camel-4) is shutdown in 0.008 seconds
2014-02-28 14:28:28,412 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: camel-1) is shutting down
2014-02-28 14:28:28,412 [main ] INFO DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 300 seconds)
2014-02-28 14:28:28,413 [ - ShutdownTask] INFO DefaultShutdownStrategy - Route: route1 shutdown complete, was consuming from: Endpoint[timer://logMessageTimer?period=1s]
2014-02-28 14:28:28,413 [main ] INFO DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
2014-02-28 14:28:28,416 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: camel-1) uptime 10.826 seconds
2014-02-28 14:28:28,416 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: camel-1) is shutdown in 0.004 seconds
2014-02-28 14:28:28,416 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: context1) is shutting down
2014-02-28 14:28:28,416 [main ] INFO DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 300 seconds)
2014-02-28 14:28:33,119 [ - ShutdownTask] INFO DefaultShutdownStrategy - Route: FirstRoute shutdown complete, was consuming from: Endpoint[jms://queue:jmsinqueue]
2014-02-28 14:28:33,119 [main ] INFO DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 4 seconds
2014-02-28 14:28:33,122 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: context1) uptime 15.164 seconds
2014-02-28 14:28:33,122 [main ] INFO SpringCamelContext - Apache Camel 2.12.2 (CamelContext: context1) is shutdown in 4.706 seconds
Auf dem wildFly Seite die es nur gibt Folgendes aus wenn ich das Programm über.
14:28:17,117 INFO [org.jboss.als.naming] (default-task-12) JBAS011806: Kanal Ende notification received, closing channel ID 62358a57 (inbound) Remoting-Verbindung 78dd3e11 /127.0.0.1:49754
Wo mache ich falsch ... bitte Beratung .
InformationsquelleAutor danielmwai | 2014-02-28
Du musst angemeldet sein, um einen Kommentar abzugeben.
Stellen Sie sicher, Sie verwenden die gleiche version von HornetQ für Camel als für WildFly.
Fehler, Sie sind nicht das gleiche (sollte es HornetQ 2.4.1.Final)
Danke, ich hatte einen zweiten Blick und ich gefunden zu haben, der meine pom.xml ich habe beide 2.4.0 und hornetq-jms-client mit version 2.4.1
InformationsquelleAutor jmesnil