title: Differentiate between data coming in my Service bus Queue
body: <p>Below is an Azure function which pushes data in My Service Bus from my cosmos db. this is already written code and here they check the different metadata before returning the Json to service bus. Now I have to write another function where I am pulling these data from Service bus and processing it further based on data coming from above function or from other sources as the requirement is changing and I might get data in Service Bus from other sources. I would like to know how can I distinguish these data to identify which comes from where.</p>
  <pre><code>[FunctionName( &quot;Push Data to Service Bus&quot; )]
          [return: ServiceBus( &quot;topicname&quot;, Connection = &quot;ServiceBusConnection&quot; )]
          public static string Notify(
              [CosmosDBTrigger(
                  databaseName: &quot;test&quot;,
                  collectionName: &quot;testcontay&quot;,
                  ConnectionStringSetting = &quot;CosmosDBConnection&quot;,
                  LeaseCollectionName = &quot;leases&quot;,
                  CreateLeaseCollectionIfNotExists = true)]
                  IReadOnlyList&lt;Document&gt; documents,
              ILogger log )
          {
              if( documents == null || documents.Count == 0 )
              {
                  log.LogWarning( &quot;No documents received&quot; );
                  return null;
              }
  
  
              var triggerDocs =
                  (from d in documents
                   let trigger = d.GetPropertyValue&lt;bool?&gt;( &quot;Trigger&quot; )
                   where !trigger.HasValue || trigger == true
                   select new
                   {
                       Id = d.GetPropertyValue&lt;string&gt;( &quot;id&quot; ),
                       Project = d.GetPropertyValue&lt;string&gt;( &quot;Project&quot; ),
                       ProjectId = d.GetPropertyValue&lt;string&gt;( &quot;ProjectId&quot; ),
                       Tags = d.GetPropertyValue&lt;string[]&gt;( &quot;Tags&quot; ),
                       Properties = d.GetPropertyValue&lt;Dictionary&lt;string, object&gt;&gt;( &quot;Properties&quot; ),
                       Categories = d.GetPropertyValue&lt;string[]&gt;( &quot;Categories&quot; ),
                       Trigger = d.GetPropertyValue&lt;bool?&gt;( &quot;Trigger&quot; ),
                       Received = DateTime.UtcNow
                   }).ToList();
  
  
              log.LogInformation( $&quot;Documents triggered: {triggerDocs.Count}&quot; );
  
              if( triggerDocs.Count() == 0 )
                  return string.Empty;
  
              var json = JsonSerializer.Serialize( triggerDocs, triggerDocs.GetType() );
              return json;
          }
  
  
  [FunctionName( &quot;GettingDataFromServiceBus&quot; )]
          public async void Run([ServiceBusTrigger(&quot;topicname&quot;, &quot;subscriptionname&quot;,
              Connection = &quot;AzureServiceBusString&quot;)] 
              string SbMsg, ExecutionContext context,
              ILogger log)
          {
             
                  if (!string.IsNullOrEmpty(SbMsg))
                  {
                      log.LogInformation($&quot;C# ServiceBus topic trigger function processed message: {SbMsg}&quot;);
  }
  }
  </code></pre>