Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 984 Bytes

shovel-get.md

File metadata and controls

40 lines (29 loc) · 984 Bytes

Get Shovels

The Broker API allows you to get all shovels on the RabbitMQ broker. To do so is pretty simple with HareDu 2. You can do it yourself or the DI way.

Do It Yourself

var result = await new BrokerObjectFactory(config)
    .Object<Shovel>()
    .GetAll();

Autofac

var result = await _container.Resolve<IBrokerObjectFactory>()
    .Object<Shovel>()
    .GetAll();

Microsoft DI

var result = await _services.GetService<IBrokerObjectFactory>()
    .Object<Shovel>()
    .GetAll();

The other way to get consumer information is to call the extension methods off of IBrokerObjectFactory like so...

var result = await _services.GetService<IBrokerObjectFactory>()
    .GetAllShovels();

All examples in this document assumes the broker has been configured. If you want to know how then go to the Configuration documentation here.