Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:18:20+00:00 2026-05-31T16:18:20+00:00

I am working on a product data importing system which downloads product data from

  • 0

I am working on a product data importing system which downloads product data from external sources, translates it into the proper schema, and stores the results – essentially an ETL system. The core type of message the system handles is “ImportProductCommand” which specifies the product to import and the source. Import commands however, are rarely sent individually. A typical business requirement is to import a whole set of products from a given source. Currently, this is expressed as an “ImportProductsCommand” message which can specify multiple products to import. A command handler consumes this message, converts it into individual “ImportProductCommand” messages and sends them to a queue for processing. The consumer of individual import requests publishes a “ProductImportedEvent” or “ProductImportFailedEvent”. When the “ImportProductsCommand” message is received, the service assigns a GUID token to the message, places the message on a queue, and returns the token. The token is then used as a correlation ID so that individual import requests can be associated with the batch import request. Given this infrastructure, it is possible to determine the number of events associated with a given token, and thus the number of imported products or failed imports. What is missing is an explicit event to indicate that a batch import has completed. The handler of individual import requests isn’t explicitly aware that it is part of a batch import request. This of course can be inferred by knowing how many products were to be imported and by counting the number of import events associated with a specific correlation ID. The currently implementation leverages the message queue system to handle process restarts and failures, but is less explicit about the batch import request. Overall, the queries the system needs to answer are:

  • Is a given batch import done?
  • How many individual imports are remaining for a given batch import?
  • How many individual imports completed?
  • How many were erroneous?

What are some best practices or suggested approaches to support these queries and still leverage the message queuing system for resilience? Currently, what ties it all together is the token mentioned above, but there is no explicit record to represent the batch import request entity, and if there was, then the individual import request processor would need to be aware of such an entity to update the status accordingly.

All of this is implemented using C#, NServiceBus and hosted as an IIS WCF application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:18:22+00:00Added an answer on May 31, 2026 at 4:18 pm

    This can be implemented as NServiceBus Saga. ImportProductsCommand should be handled by a Saga(ImportProductsSaga), and Saga data can have the count of products to be imported as it sends the ImportProductCommand. ImportProductsSaga should handle ProductImportedEvent and ProductImportFailedEvent. On each of this event handled in ImportProductsSaga, increment ProductsImported or ProdctsFailedToImport. Also check the sum of (ProductsImported + ProdctsFailedToImport) equals to ProdctsToBeImported, if so, complete the saga.

    ImportProductsSaga data needs to keep track of No of ImportProductCommand send, and reply received and you can calculate the pending reply etc.
    Saga data look something like following e.g:

       public class ImportProductsSataData{ 
           public Guid Id {get; set}
           public int ProdctsToBeImported {get; set}
           public int ProdctsImported {get; set}
           public int ProdctsFailedToImport {get; set}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a Matlab API that loads data from a proprietary format into
I'm working on a product feature that will allow the user to export data
I am working on a product that runs an SQL server which allows some
I'm working on a product which relies on several different projects each hosted in
Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so,
I'm currently working on a website that imports XML data that we download from
Essentially I need to group unique product data into a single row when: The
I am working on a concept product which tries to solve the domain problems
I am currently working on system that generated product recommendations like those on Amazon
I've been working on a Web Server which produces XML data to be used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.