public SendSettings GetSendSettings(ActiveMqEndpointAddress address)
        {
            if (address.Type == ActiveMqEndpointAddress.AddressType.Queue)
            {
                return(new QueueSendSettings(address));
            }

            return(new TopicSendSettings(address));
        }
        public override bool TryGetPublishAddress(Type messageType, out Uri publishAddress)
        {
            if (base.TryGetPublishAddress(messageType, out publishAddress))
            {
                publishAddress = new ActiveMqEndpointAddress(_hostConfiguration.HostAddress, publishAddress).TopicAddress;
                return(true);
            }

            return(false);
        }
        public Uri GetDestinationAddress(string topicName, Action <ITopicConfigurator> configure = null)
        {
            var address = new ActiveMqEndpointAddress(_hostConfiguration.HostAddress, new Uri($"topic:{topicName}"));

            var sendSettings = new TopicSendSettings(address);

            configure?.Invoke(sendSettings);

            return(sendSettings.GetSendAddress(_hostConfiguration.HostAddress));
        }
Ejemplo n.º 4
0
        public Task <ISendTransport> CreateSendTransport(ActiveMqEndpointAddress address)
        {
            var settings = _hostTopology.SendTopology.GetSendSettings(address);

            var sessionContextSupervisor = CreateSessionContextSupervisor();

            var configureTopology = new ConfigureTopologyFilter <SendSettings>(settings, settings.GetBrokerTopology()).ToPipe();

            return(CreateSendTransport(sessionContextSupervisor, configureTopology, settings.EntityName, DestinationType.Queue));
        }
Ejemplo n.º 5
0
        public Uri GetDestinationAddress(Type messageType, Action <ITopicConfigurator> configure = null)
        {
            var queueName   = _messageNameFormatter.GetMessageName(messageType).ToString();
            var isTemporary = TypeMetadataCache.IsTemporaryMessageType(messageType);

            var address = new ActiveMqEndpointAddress(_hostAddress, new Uri($"topic:{queueName}?temporary={isTemporary}"));

            var settings = new TopicSendSettings(address);

            configure?.Invoke(settings);

            return(settings.GetSendAddress(_hostAddress));
        }
Ejemplo n.º 6
0
        public Task <ISendTransport> CreateSendTransport(ISessionContextSupervisor sessionContextSupervisor, Uri address)
        {
            LogContext.SetCurrentIfNull(_hostConfiguration.LogContext);

            var endpointAddress = new ActiveMqEndpointAddress(_hostConfiguration.HostAddress, address);

            TransportLogMessages.CreateSendTransport(endpointAddress);

            var settings = _topologyConfiguration.Send.GetSendSettings(endpointAddress);

            IPipe <SessionContext> configureTopology = new ConfigureTopologyFilter <SendSettings>(settings, settings.GetBrokerTopology()).ToPipe();

            return(CreateSendTransport(sessionContextSupervisor, configureTopology, settings.EntityName,
                                       endpointAddress.Type == ActiveMqEndpointAddress.AddressType.Queue ? DestinationType.Queue : DestinationType.Topic));
        }
        public SendSettings GetSendSettings(Uri address)
        {
            var endpointAddress = new ActiveMqEndpointAddress(_hostConfiguration.HostAddress, address);

            return(_topologyConfiguration.Send.GetSendSettings(endpointAddress));
        }
Ejemplo n.º 8
0
 public TopicSendSettings(ActiveMqEndpointAddress address)
     : base(address.Name, address.Durable, address.AutoDelete)
 {
 }
Ejemplo n.º 9
0
        Task <ISendTransport> ISendTransportProvider.GetSendTransport(Uri address)
        {
            var endpointAddress = new ActiveMqEndpointAddress(_host.Address, address);

            return(_host.CreateSendTransport(endpointAddress));
        }