Service Control Failed Message does not come myhandler Subcription does not created

nservicebus

(Amit Sharma) #1

I want to strore all failed message into database or blob staorage for that
i have done all configuration according to https://docs.particular.net/servicecontrol/contracts

Create an Endpoint

configuration.EndpointName(GetEndpointName());
var conventions = configuration.Conventions();
conventions.DefiningEventsAs(
  type => typeof(IEvent).IsAssignableFrom(type) ||
  // include ServiceControl events
  type.Namespace != null &&
  type.Namespace.StartsWith("ServiceControl.Contracts"));
//configuration.Conventions().DefiningEventsAs(t => t.IsAssignableFrom(t) || t.Namespace != null && t.Namespace.StartsWith("ServiceControl.Contracts");
configuration.AssembliesToScan();
configuration.UseContainer<StructureMapBuilder>(c => c.ExistingContainer(Bootstrapper.Instance.Container));
configuration.EnableInboxAndOutbox();
configuration.DefineCriticalErrorAction(OnCriticalError);
DisableSlr(configuration);
configuration.UseSerialization<JsonSerializer>();

Config File setting

<UnicastBusConfig>
  <MessageEndpointMappings >
    <add Assembly="ServiceControl.Contracts"
         Endpoint="Particular.ServiceControl" />
  </MessageEndpointMappings>
</UnicastBusConfig>

Crete a new handle

public void Handle(MessageFailed message)
{
  //save failed message in database here.
}

Problem
Failed message is coming on my handler while same message i am receiveing on service pluse.

can anybody help me out what i am missing in configuration or settings so messaged arrived at my handler when failed message event come from service control

When i verified on azure service bus then my servicecontrol event subscription does not create under ServiceControl topic.

Regards,
Amit Sharm


(Sean Feldman) #2

Hi Amit,

What does your endpoint transport configuration looks like and what version on NServiceBus and Azure ServiceBus transport is it using?


(Amit Sharma) #3

Hi Sean,

endpointConfiguration.UseTransport();
endpointConfiguration.UseSerialization();
NServiceBus nuget version - 5.2.9


(Sean Feldman) #4

Are UseTransport() and UseSerialization() your own extensions? NServiceBus API requires to provide generic argument. It would be helpful to see what those are.

Also, when you’re saying

When i verified on azure service bus then my servicecontrol event subscription does not create under ServiceControl topic.

Do you mean subscriptions are not created at all or they are created in wrong location?
Could you provide a snapshot of what you see in SBExplorer?

Thank you.


(Amit Sharma) #5

endpointConfiguration.UseTransport<AzureServiceBusTransport>();
endpointConfiguration.UseSerialization<JsonSerializer>();

@Sane - Do you mean subscriptions are not created at all or they are created in wrong location?
@Amit - Yes , subscriptions are not created at all any of of the location.

I have created endpoint name is HM.Disco.Databus.cleaner.endpoint which is highlighted with blue no. 1

Config settings

Dev config Settings
these settings will replace into base config file


(Sean Feldman) #6

Hi Amit,
Subscriptions would not be created for a few reasons. Among those could be

  • Auto-subscriptions is turned off. Check your endpoint to see that’s not the case.
  • Your endpoint doesn’t have a connection string management rights. Verify your connection string has management rights.
  • Misconfigured SC queue name and subscriptions are registered against a topic that doesn’t get any messages. Verify that’s not the case by reviewing topics.

If non above works, let’s switch to an email and I’ll try to review the code.

Sean