Apache.NMS.ISession.GetTopic(string)

Here are the examples of the csharp api class Apache.NMS.ISession.GetTopic(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

1. Example

Project: spring-net
Source File: CachedSession.cs
public ITopic GetTopic(string name)
        {
            this.transactionOpen = true;
            return target.GetTopic(name);
        }

2. Example

Project: spring-net
Source File: DynamicDestinationResolver.cs
protected internal virtual IDestination ResolveTopic(ISession session, System.String topicName)
        {
            return session.GetTopic(topicName);
        }

3. Example

Project: nova
Source File: ActiveMQSender.cs
public string update_enter(Dictionary<string, object> parameters)
        {
            try
            { 
                string label = (string)parameters["label"];
                string topicname = (string)parameters["topic"];

                ITopic topic = session.GetTopic(topicname);
                using (IMessageProducer producer = session.CreateProducer(topic))
                {
                    var textMessage = producer.CreateTextMessage(label);
                    producer.Send(textMessage);
                }
               
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }

            return null;
        }

4. Example

Project: dxa-web-application-dotnet
Source File: JMSMessageProvider.cs
private void StartConnection()
        {
            // Connection to apcaheMQ, the connection should stay open! 
            // That means that this object should be kept in memory. 1 way to achieve this, is to register it as a SingleInstance in your DI container
            Uri connecturi = new Uri(string.Format("activemq:tcp://{0}:{1}", _configuration.JMSHostname, _configuration.JMSPort));

            IConnectionFactory factory = new ConnectionFactory(connecturi);

            _connection = factory.CreateConnection();
            _connection.ClientId = "DD4TJMSListener-" + Guid.NewGuid().ToString();
            _connection.ExceptionListener += connection_ExceptionListener;
            _connection.Start();
            ISession session = _connection.CreateSession(AcknowledgementMode.ClientAcknowledge);
            IDestination destination = session.GetTopic(_configuration.JMSTopic);
            IMessageConsumer consumer = session.CreateConsumer(destination);
            consumer.Listener += new MessageListener(HandleMessage);
        }

5. Example

Project: dxa-web-application-dotnet
Source File: JMSListener.cs
private void StartConnection()
        {
            Uri connecturi = new Uri(string.Format("activem/n ..... /n //View Source file for more details /n }