Class ActiveMQComponent

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultComponent
org.apache.camel.support.HeaderFilterStrategyComponent
org.apache.camel.component.jms.JmsComponent
org.apache.camel.component.activemq.ActiveMQComponent
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@Component("activemq") public class ActiveMQComponent extends org.apache.camel.component.jms.JmsComponent
The ActiveMQ Component.
  • Field Summary

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ActiveMQComponent(org.apache.camel.CamelContext context)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an ActiveMQ Component connecting to the given broker URL
    protected void
    addPooledConnectionFactoryService(Object pooledConnectionFactoryService)
     
    protected void
    addSingleConnectionFactory(org.springframework.jms.connection.SingleConnectionFactory singleConnectionFactory)
     
    protected String
     
    protected org.apache.camel.component.jms.JmsConfiguration
     
    protected org.apache.camel.component.jms.JmsEndpoint
    createQueueEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration, org.apache.camel.component.jms.QueueBrowseStrategy queueBrowseStrategy)
     
    protected org.apache.camel.component.jms.JmsEndpoint
    createTemporaryQueueEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration, org.apache.camel.component.jms.QueueBrowseStrategy queueBrowseStrategy)
     
    protected org.apache.camel.component.jms.JmsEndpoint
    createTemporaryTopicEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration)
     
    protected org.apache.camel.component.jms.JmsEndpoint
    createTopicEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration)
     
    protected void
     
    protected void
     
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    void
    setBrokerURL(String brokerURL)
    Sets the broker URL to use to connect to ActiveMQ.
    void
    setConfiguration(org.apache.camel.component.jms.JmsConfiguration configuration)
    Configuration of ActiveMQ
    void
    setEmbedded(boolean embedded)
    Use an embedded in-memory (non-persistent) ActiveMQ broker for development and testing purposes.
    protected void
    setProperties(org.apache.camel.Endpoint bean, Map<String,Object> parameters)
     
    void
    setTrustAllPackages(boolean trustAllPackages)
    Define if all Java packages are trusted or not (for Java object JMS message types).
    void
    setUsePooledConnection(boolean usePooledConnection)
    Enables or disables whether a PooledConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again.
    void
    setUseSingleConnection(boolean useSingleConnection)
    Enables or disables whether a Spring SingleConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again.

    Methods inherited from class org.apache.camel.component.jms.JmsComponent

    chooseMessageListenerContainerImplementation, configuredQoS, configureMessageListener, configureMessageListenerContainer, copy, createConnectionFactory, createDestinationResolver, createEndpoint, createInOnlyTemplate, createInOutTemplate, createListenerConnectionFactory, createMessageListenerContainer, createTemplateConnectionFactory, createTransactionManager, defaultCacheLevel, doShutdown, getAcknowledgementMode, getAcknowledgementModeName, getAllowAdditionalHeaders, getArtemisConsumerPriority, getAsyncStartStopExecutorService, getCacheLevel, getCacheLevelName, getClientId, getConcurrentConsumers, getConfiguration, getConnectionFactory, getConsumerType, getCorrelationProperty, getDefaultTaskExecutorType, getDeliveryDelay, getDeliveryMode, getDestinationResolver, getDurableSubscriptionName, getEagerPoisonBody, getErrorHandler, getErrorHandlerLoggingLevel, getExceptionListener, getExplicitQosEnabled, getIdleConsumerLimit, getIdleReceivesPerTaskLimit, getIdleTaskExecutionLimit, getJmsKeyFormatStrategy, getJmsMessageType, getJmsOperations, getListenerConnectionFactory, getMaxConcurrentConsumers, getMaxMessagesPerTask, getMessageConverter, getMessageCreatedStrategy, getMessageListenerContainerFactory, getOrCreateConnectionFactory, getOrCreateListenerConnectionFactory, getOrCreateTemplateConnectionFactory, getOrCreateTransactionManager, getPassword, getPriority, getQueueBrowseStrategy, getReceiveTimeout, getRecoveryInterval, getReplyTo, getReplyToCacheLevelName, getReplyToConcurrentConsumers, getReplyToConsumerType, getReplyToDestinationSelectorName, getReplyToMaxConcurrentConsumers, getReplyToOnTimeoutMaxConcurrentConsumers, getReplyToOverride, getReplyToType, getRequestTimeout, getRequestTimeoutCheckerInterval, getSelector, getSubscriptionName, getTaskExecutor, getTemplateConnectionFactory, getTemporaryQueueResolver, getTimeToLive, getTransactionManager, getTransactionName, getTransactionTimeout, getUsername, getWaitForProvisionCorrelationToBeUpdatedCounter, getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime, getWaitForTemporaryReplyToToBeUpdatedCounter, getWaitForTemporaryReplyToToBeUpdatedThreadSleepingTime, isAcceptMessagesWhileStopping, isAllowAutoWiredConnectionFactory, isAllowAutoWiredDestinationResolver, isAllowNullBody, isAllowReplyManagerQuickStop, isAllowSerializedHeaders, isAlwaysCopyMessage, isArtemisStreamingEnabled, isAsyncConsumer, isAsyncStartListener, isAsyncStopListener, isAutoStartup, isDeliveryPersistent, isDisableReplyTo, isDisableTimeToLive, isEagerLoadingOfProperties, isErrorHandlerLogStackTrace, isExplicitQosEnabled, isExposeListenerSession, isForceSendOriginalMessage, isFormatDateHeadersToIso8601, isIncludeAllJMSXProperties, isIncludeCorrelationIDAsBytes, isIncludeSentJMSMessageID, isLazyCreateTransactionManager, isMapJmsMessage, isMessageIdEnabled, isMessageTimestampEnabled, isPreserveMessageQos, isPubSubNoLocal, isReplyToDeliveryPersistent, isReplyToSameDestinationAllowed, isServiceLocationEnabled, isStreamMessageTypeEnabled, isSubscriptionDurable, isSubscriptionShared, isTestConnectionOnStartup, isTransacted, isTransactedInOut, isTransferException, isTransferExchange, isUseMessageIDAsCorrelationID, jmsComponent, jmsComponent, jmsComponent, jmsComponentAutoAcknowledge, jmsComponentClientAcknowledge, jmsComponentTransacted, jmsComponentTransacted, setAcceptMessagesWhileStopping, setAcknowledgementMode, setAcknowledgementModeName, setAllowAdditionalHeaders, setAllowAutoWiredConnectionFactory, setAllowAutoWiredDestinationResolver, setAllowNullBody, setAllowReplyManagerQuickStop, setAllowSerializedHeaders, setAlwaysCopyMessage, setArtemisConsumerPriority, setArtemisStreamingEnabled, setAsyncConsumer, setAsyncStartListener, setAsyncStopListener, setAutoStartup, setCacheLevel, setCacheLevelName, setClientId, setConcurrentConsumers, setConnectionFactory, setConsumerType, setCorrelationProperty, setDefaultTaskExecutorType, setDeliveryDelay, setDeliveryMode, setDeliveryPersistent, setDestinationResolver, setDisableReplyTo, setDisableTimeToLive, setDurableSubscriptionName, setEagerLoadingOfProperties, setEagerPoisonBody, setErrorHandler, setErrorHandlerLoggingLevel, setErrorHandlerLogStackTrace, setExceptionListener, setExplicitQosEnabled, setExposeListenerSession, setForceSendOriginalMessage, setFormatDateHeadersToIso8601, setIdleConsumerLimit, setIdleReceivesPerTaskLimit, setIdleTaskExecutionLimit, setIncludeAllJMSXProperties, setIncludeCorrelationIDAsBytes, setIncludeSentJMSMessageID, setJmsKeyFormatStrategy, setJmsMessageType, setJmsOperations, setLazyCreateTransactionManager, setListenerConnectionFactory, setMapJmsMessage, setMaxConcurrentConsumers, setMaxMessagesPerTask, setMessageConverter, setMessageCreatedStrategy, setMessageIdEnabled, setMessageListenerContainerFactory, setMessageTimestampEnabled, setPassword, setPreserveMessageQos, setPriority, setPubSubNoLocal, setQueueBrowseStrategy, setReceiveTimeout, setRecoveryInterval, setReplyTo, setReplyToCacheLevelName, setReplyToConcurrentConsumers, setReplyToConsumerType, setReplyToDeliveryPersistent, setReplyToDestinationSelectorName, setReplyToMaxConcurrentConsumers, setReplyToOnTimeoutMaxConcurrentConsumers, setReplyToOverride, setReplyToSameDestinationAllowed, setReplyToType, setRequestTimeout, setRequestTimeoutCheckerInterval, setSelector, setServiceLocationEnabled, setStreamMessageTypeEnabled, setSubscriptionDurable, setSubscriptionName, setSubscriptionShared, setTaskExecutor, setTemplateConnectionFactory, setTemporaryQueueResolver, setTestConnectionOnStartup, setTimeToLive, setTransacted, setTransactedInOut, setTransactionManager, setTransactionName, setTransactionTimeout, setTransferException, setTransferExchange, setUseMessageIDAsCorrelationID, setUsername, setWaitForProvisionCorrelationToBeUpdatedCounter, setWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime, setWaitForTemporaryReplyToToBeUpdatedCounter, setWaitForTemporaryReplyToToBeUpdatedThreadSleepingTime, supportBlobMessage

    Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent

    getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy

    Methods inherited from class org.apache.camel.support.DefaultComponent

    afterConfiguration, createEndpoint, createEndpoint, doBuild, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doFail, doLifecycleChange, doResume, doStart, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Constructor Details

    • ActiveMQComponent

      public ActiveMQComponent()
    • ActiveMQComponent

      public ActiveMQComponent(org.apache.camel.CamelContext context)
    • ActiveMQComponent

      public ActiveMQComponent(ActiveMQConfiguration configuration)
  • Method Details

    • activeMQComponent

      public static ActiveMQComponent activeMQComponent()
      Returns:
      the created component
    • activeMQComponent

      public static ActiveMQComponent activeMQComponent(String brokerURL)
      Creates an ActiveMQ Component connecting to the given broker URL
      Parameters:
      brokerURL - the URL to connect to
      Returns:
      the created component
    • isEmbedded

      public boolean isEmbedded()
    • setEmbedded

      @Metadata(label="common") public void setEmbedded(boolean embedded)
      Use an embedded in-memory (non-persistent) ActiveMQ broker for development and testing purposes. You must have activemq-broker JAR on the classpath.
    • getBrokerURL

      public String getBrokerURL()
    • setBrokerURL

      @Metadata(label="common") public void setBrokerURL(String brokerURL)
      Sets the broker URL to use to connect to ActiveMQ. If none configured then localhost:61616 is used by default (however can be overridden by configuration from environment variables)
    • setTrustAllPackages

      @Metadata(defaultValue="false", label="advanced") public void setTrustAllPackages(boolean trustAllPackages)
      Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care.
    • isTrustAllPackages

      public boolean isTrustAllPackages()
    • setUsePooledConnection

      @Metadata(defaultValue="true", label="common") public void setUsePooledConnection(boolean usePooledConnection)
      Enables or disables whether a PooledConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again.

      The default value is true.

    • isUsePooledConnection

      public boolean isUsePooledConnection()
    • setUseSingleConnection

      @Metadata(defaultValue="false", label="common") public void setUseSingleConnection(boolean useSingleConnection)
      Enables or disables whether a Spring SingleConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again.

      The default value is false and a pooled connection is used by default.

    • isUseSingleConnection

      public boolean isUseSingleConnection()
    • setProperties

      protected void setProperties(org.apache.camel.Endpoint bean, Map<String,Object> parameters) throws Exception
      Overrides:
      setProperties in class org.apache.camel.support.DefaultComponent
      Throws:
      Exception
    • addPooledConnectionFactoryService

      protected void addPooledConnectionFactoryService(Object pooledConnectionFactoryService)
    • addSingleConnectionFactory

      protected void addSingleConnectionFactory(org.springframework.jms.connection.SingleConnectionFactory singleConnectionFactory)
    • convertPathToActualDestination

      protected String convertPathToActualDestination(String path, Map<String,Object> parameters)
      Overrides:
      convertPathToActualDestination in class org.apache.camel.component.jms.JmsComponent
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.component.jms.JmsComponent
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • setConfiguration

      public void setConfiguration(org.apache.camel.component.jms.JmsConfiguration configuration)
      Configuration of ActiveMQ
      Overrides:
      setConfiguration in class org.apache.camel.component.jms.JmsComponent
    • createConfiguration

      protected org.apache.camel.component.jms.JmsConfiguration createConfiguration()
      Overrides:
      createConfiguration in class org.apache.camel.component.jms.JmsComponent
    • createTemporaryTopicEndpoint

      protected org.apache.camel.component.jms.JmsEndpoint createTemporaryTopicEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration)
      Overrides:
      createTemporaryTopicEndpoint in class org.apache.camel.component.jms.JmsComponent
    • createTopicEndpoint

      protected org.apache.camel.component.jms.JmsEndpoint createTopicEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration)
      Overrides:
      createTopicEndpoint in class org.apache.camel.component.jms.JmsComponent
    • createTemporaryQueueEndpoint

      protected org.apache.camel.component.jms.JmsEndpoint createTemporaryQueueEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration, org.apache.camel.component.jms.QueueBrowseStrategy queueBrowseStrategy)
      Overrides:
      createTemporaryQueueEndpoint in class org.apache.camel.component.jms.JmsComponent
    • createQueueEndpoint

      protected org.apache.camel.component.jms.JmsEndpoint createQueueEndpoint(String uri, org.apache.camel.component.jms.JmsComponent component, String subject, org.apache.camel.component.jms.JmsConfiguration configuration, org.apache.camel.component.jms.QueueBrowseStrategy queueBrowseStrategy)
      Overrides:
      createQueueEndpoint in class org.apache.camel.component.jms.JmsComponent