当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQComponent.setBrokerURL方法代码示例

本文整理汇总了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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:WidgetApplication.java

示例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");
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:23,代码来源:InventoryRoute.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:WidgetMain.java

示例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"));
}
 
开发者ID:fcrepo4-exts,项目名称:fcrepo-camel-toolbox,代码行数:16,代码来源:RouteIT.java

示例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"));
}
 
开发者ID:fcrepo4-exts,项目名称:fcrepo-camel-toolbox,代码行数:16,代码来源:RouteIT.java

示例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"));
}
 
开发者ID:fcrepo4-exts,项目名称:fcrepo-camel-toolbox,代码行数:11,代码来源:RouteIT.java

示例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;
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:11,代码来源:InventoryRoute.java


注:本文中的org.apache.activemq.camel.component.ActiveMQComponent.setBrokerURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。