title: How to consume from topic MassTransit
body: <p>I'm trying to consume from a topic using Masstransit, but I can't understand how to call the consume-method?</p>
  
  <p>Here is my configuration:</p>
  
  <pre><code>    services.AddMassTransit(serviceCollectionConfigurator =&gt;
      {
          serviceCollectionConfigurator.AddBus(provider =&gt; Bus.Factory.CreateUsingAzureServiceBus(busFactoryConfigurator =&gt;
          {
              var host = busFactoryConfigurator.Host(new Uri(serviceBusConfig.HostName), hostConfigurator =&gt;
              hostConfigurator.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(
                  serviceBusConfig.SharedAccessKey,
                  serviceBusConfig.Key));
  
                  //busFactoryConfigurator.Message&lt;IInterface&gt;(topology =&gt; topology.SetEntityName(sevicesBusConfig.TopicName));
  
                  // Subscribe to topic with a subscription
                  busFactoryConfigurator.SubscriptionEndpoint(serviceBusConfig.Subscription, serviceBusConfig.TopicName, e =&gt;
              {
                  e.ConfigureConsumer&lt;ConsumeMessageService&gt;(provider);
              });
          }));
      });
  </code></pre>
  
  <p>Here is my ConsumerMessageService</p>
  
  <pre><code>public class ConsumeMessageService : IConsumeMessageService, IConsumer&lt;MessageA&gt;
  {
      public Task Consume(ConsumeContext&lt;MessageA&gt; context)
      {
          return context.RespondAsync(new ResponseA { Value = context.Message.ToString() });
      }
  }
  
  public class ResponseA
  {
      public string Value { get; set; }
  }
  </code></pre>
  
  <p>How can I access the Consume-method from another service? Must I create a Context and then send it as a parameter?</p>
  
  <p>EDIT:
  I currently have 2messages in Azure Service Bus. How can I get the messages and return them to the controller? In some how I must retrieve the messages from the ConsumerService and return It to the controller. How can I do that? Can you please show me an example of this? I can't get my head around this and understand how I do this..</p>