本文整理汇总了Java中org.apache.activemq.camel.component.ActiveMQComponent.setBrokerURL方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQComponent.setBrokerURL方法的具体用法?Java ActiveMQComponent.setBrokerURL怎么用?Java ActiveMQComponent.setBrokerURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.camel.component.ActiveMQComponent
的用法示例。
在下文中一共展示了ActiveMQComponent.setBrokerURL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActiveMQComponent
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
/**
* Factory to create the {@link ActiveMQComponent} which is used in this application
* to connect to the remote ActiveMQ broker.
*/
@Produces
public static ActiveMQComponent createActiveMQComponent() {
// you can set other options but this is the basic just needed
ActiveMQComponent amq = new ActiveMQComponent();
// The ActiveMQ Broker allows anonymous connection by default
// amq.setUserName("admin");
// amq.setPassword("admin");
// the url to the remote ActiveMQ broker
amq.setBrokerURL("tcp://localhost:61616");
return amq;
}
示例2: configure
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
@Override
public void configure() throws Exception {
JaxbDataFormat jaxb = new JaxbDataFormat();
jaxb.setContextPath("camelinaction");
// TODO: due activemq bug we need to configure it here also
ActiveMQComponent jms = new ActiveMQComponent(getContext());
jms.setBrokerURL("tcp://localhost:61616");
getContext().addComponent("jms", jms);
from("direct:inventory")
.log("Calling inventory service using JMS")
.hystrix()
// call the legacy system using JMS
.to("jms:queue:inventory")
// the returned data is in XML format so convert that to POJO using JAXB
.unmarshal(jaxb)
.onFallback()
.log("Circuit breaker failed so using fallback response")
// fallback and read inventory from classpath which is in XML format
.transform().constant("resource:classpath:fallback-inventory.xml");
}
示例3: createActiveMQComponent
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
public static ActiveMQComponent createActiveMQComponent() {
// you can set other options but this is the basic just needed
ActiveMQComponent amq = new ActiveMQComponent();
// The ActiveMQ Broker allows anonymous connection by default
// amq.setUserName("admin");
// amq.setPassword("admin");
// the url to the remote ActiveMQ broker
amq.setBrokerURL("tcp://localhost:61616");
return amq;
}
示例4: addServicesOnStartup
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
@Override
protected void addServicesOnStartup(final Map<String, KeyValueHolder<Object, Dictionary>> services) {
final String jmsPort = System.getProperty("fcrepo.dynamic.jms.port", "61616");
final String webPort = System.getProperty("fcrepo.dynamic.test.port", "8080");
final ActiveMQComponent component = new ActiveMQComponent();
component.setBrokerURL("tcp://localhost:" + jmsPort);
component.setExposeAllQueues(true);
final FcrepoComponent fcrepo = new FcrepoComponent();
fcrepo.setBaseUrl("http://localhost:" + webPort + "/fcrepo/rest");
services.put("broker", asService(component, "osgi.jndi.service.name", "fcrepo/Broker"));
services.put("fcrepo", asService(fcrepo, "osgi.jndi.service.name", "fcrepo/Camel"));
}
示例5: addServicesOnStartup
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
@Override
protected void addServicesOnStartup(final Map<String, KeyValueHolder<Object, Dictionary>> services) {
final String jmsPort = System.getProperty("fcrepo.dynamic.jms.port", "61616");
final String webPort = System.getProperty("fcrepo.dynamic.test.port", "8080");
final ActiveMQComponent amq = new ActiveMQComponent();
amq.setBrokerURL("tcp://localhost:" + jmsPort);
amq.setExposeAllQueues(true);
final FcrepoComponent fcrepo = new FcrepoComponent();
fcrepo.setBaseUrl("http://localhost:" + webPort + "/fcrepo/rest");
services.put("broker", asService(amq, "osgi.jndi.service.name", "fcrepo/Broker"));
services.put("fcrepo", asService(fcrepo, "osgi.jndi.service.name", "fcrepo/Camel"));
}
示例6: addServicesOnStartup
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
@Override
protected void addServicesOnStartup(final Map<String, KeyValueHolder<Object, Dictionary>> services) {
final String jmsPort = System.getProperty("fcrepo.dynamic.jms.port", "61616");
final ActiveMQComponent component = new ActiveMQComponent();
component.setBrokerURL("tcp://localhost:" + jmsPort);
component.setExposeAllQueues(true);
services.put("broker", asService(component, "osgi.jndi.service.name", "fcrepo/Broker"));
}
示例7: jmsComponent
import org.apache.activemq.camel.component.ActiveMQComponent; //导入方法依赖的package包/类
/**
* Setup JMS component
*/
@Produces
@Named("jms")
public static JmsComponent jmsComponent() {
ActiveMQComponent jms = new ActiveMQComponent();
jms.setBrokerURL("tcp://localhost:61616");
return jms;
}