title: Spring Boot client to connect to existing JBoss EAP7 ActiveMQ
body: <p>I've been searching the web but I cannot find an example on how to connect to ActiveMQ on JBoss (up and running) with a Spring-Boot client.</p>
  
  <p>There'se a lot of tutorials from Spring but using an embedded Broker.</p>
  
  <p>Any pointers would be great!</p>
  
  <p>Thanks in advance,
  ML</p>
  
  <p>With the info provided, I've got this:</p>
  
  <pre><code>@Configuration
  @SpringBootApplication
  @EnableJms
  public class Application {
  
  @Bean
  ActiveMQConnectionFactory activeMQConnectionFactory() {
  
      final String host = "http://127.0.0.1:8080";
  
      ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(host);
      factory.setUserName("user");
      factory.setPassword("pwd");
      factory.setTrustAllPackages(true);
  
  
      return factory;
  }
  
  @Bean
  public JmsListenerContainerFactory&lt;?&gt; myFactory(ConnectionFactory connectionFactory,
          DefaultJmsListenerContainerFactoryConfigurer configurer) {
      DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
      // This provides all boot's default to this factory, including the
      // message converter
      configurer.configure(factory, connectionFactory);
      // You could still override some of Boot's default if necessary.
      return factory;
  }
  
  
  
  @Bean // Serialize message content to json using TextMessage
  public MessageConverter jacksonJmsMessageConverter() {
      MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
      converter.setTargetType(MessageType.TEXT);
      converter.setTypeIdPropertyName("_type");
      return converter;
  }
  
  public static void main(String[] args) {
      // Launch the application
      ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
  
      JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);
  
      // Send a message with a POJO - the template reuse the message converter
      System.out.println("Sending an email message.");
      jmsTemplate.convertAndSend("TestQ", new Email("info@example.com", "Hello"));
  }
  </code></pre>
  
  <p>}</p>
  
  <p>my dependencies in pom.xml:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-activemq&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
          &lt;artifactId&gt;activemq-optional&lt;/artifactId&gt;
          &lt;version&gt;5.7.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>But I've got this exception:</p>
  
  <pre><code>2017-06-01 17:55:54.176  INFO 2053 --- [           main] hello.Application                        : Started Application in 2.02 seconds (JVM running for 5.215)
  Sending an email message.
  [WARNING] 
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:527)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {wireFormat.host=127.0.0.1}
      at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
      at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)
      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570)
      at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:658)
      at hello.Application.main(Application.java:69)
      ... 6 more
  Caused by: javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {wireFormat.host=127.0.0.1}
      at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
      at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:333)
      at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:346)
      at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)
      at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)
      at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
      ... 9 more
  Caused by: java.lang.IllegalArgumentException: Invalid connect parameters: {wireFormat.host=127.0.0.1}
      at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:126)
      at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:65)
      at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:331)
      ... 14 more
  </code></pre>
  
  <p>I don't know what is this:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Invalid connect 
  parameters: {wireFormat.host=127.0.0.1}
  </code></pre>
  
  <p>thanks</p>