6

I've configured a Minion for my Sitecore Commerce solution. We're on 8.2.1.

It's set up like this:

  {
    "$type": "XYZ.Commerce.Plugin.Custom.Policies.QueuePolicy, XYZ.Commerce.Plugin.Custom",
    "ConnectionString": "[redacted]",
    "WakeupInterval": "00:05:00",
    "QueueName": "preprod",
    "Models": {
      "$type": "System.Collections.Generic.List`1[[Sitecore.Commerce.Core.Model, Sitecore.Commerce.Core]], mscorlib",
      "$values": [
      ]
    }
  }

I've been following this guide: https://websterian.com/2017/06/08/sitecore-commerce-erp-integration-an-approach-part-1-integrating-orders-and-customers/

Wherein it states:

Minions are designed to be run on schedule, the default is every five minutes but this can be changed in your environment file as per this example…

enter image description here

But this doesn't appear to be enough. My Minion still needs to be kickstarted via a post (as described elsewhere in the same linked article).

So I must be overlooking something. How can I ensure, my Minion is always up and running on a specified interval, in plain configuration?

3
  • you can log info when your minion was started or was finished Commented Dec 5, 2017 at 10:48
  • The Minion runs fine, if I start it manually with a commerceops/RunMinion() call. If I don't make this PUT request (via Postman), the Minion never runs.
    – Mark Cassidy
    Commented Dec 5, 2017 at 11:13
  • This may be specific to Commerce 9, but each MinionPolicy attached to an environment will be run when the environment starts up (via a block on the IStartEnvironmentPipeline). How is your MinionPolicy defined? Commented Feb 28, 2018 at 0:09

2 Answers 2

6

You need to reference your minion inside configure method (found in the Commerce.Engine project, Startup.cs):

You will have something like:

public void Configure(
       IApplicationBuilder app,
       IConfigureServiceApiPipeline contextPipeline,
       IStartNodePipeline startNodePipeline,
       IConfigureOpsServiceApiPipeline contextOpsServiceApiPipeline,
       IStartEnvironmentPipeline startEnvironmentPipeline,
       ILoggerFactory loggerFactory,
       IOptions<LoggingSettings> loggingSettings,
       IOptions<ApplicationInsightsSettings> applicationInsightsSettings,
       IOptions<CertificatesSettings> certificatesSettings)
       {
         //your code
         startEnvironmentPipeline.Run("yourminion", _nodeContext.GetPipelineContextOptions());
       }
5
  • I don't think this step is necessary, if you call the bootstrap command to load the JSON change to SQL Server. Commented Aug 20, 2018 at 15:23
  • Hey @DanSolovay on Sitecore 9 is not necessary to have it. Commented Aug 20, 2018 at 16:19
  • on Commerce 9, you mean. But on 8.x it was necessary.
    – Mark Cassidy
    Commented Aug 20, 2018 at 22:58
  • Yep Commerce 9 :) Commented Aug 21, 2018 at 3:19
  • Guys, thanks for clarifying. I was deep in solving this issue with 9, and missed the qualification in your question. Updating my answer to clarify. Commented Aug 22, 2018 at 17:46
0

An additional note: For Sitecore Commerce XC 9 (not 8.2.1 as in original question), it is no longer necessary to invoke it from the Commerce.Engine project, as long as you've run the Bootstrap command (located in the SitecoreCommerce_DevOps Postman collection) to get the configuration loaded to SQL Server. After that step your minion should run as normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.