Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Replying to InterApp Message causes message to be resent

Solved78 views5 hours agoInterApp
3
Bautista Solanet [SLC] [DevOps Advocate]732 21 hours ago 0 Comments

Hello Dojo,

I'm adding a new InterApp message to a driver, the way this message needs to work is that when it's received, the driver makes an API call to the device and the message then sends a reply based on the response from the API.

The issue is that when I send this message to the driver, the driver processes the message twice. When I commented out the message.reply, the driver only processes the message once.

I store the raw message initially received in a table and use that the recreate the initial message later on when I need to reply.

Here's the code:

This is how the message is sent; I've verified that this piece of code runs only once

This is how the message is sent in the ConnectorAPI Nuget; I have also verified that this only runs once. In this case, the nevionElementId is the same as the remoteElementId. The NevionReceiverPid is 9000000 and receiverPid is 9000001

This is how the response message is made later onWhich passes the reply to this method

WWhen the message.Reply is commented out, the message is no longer processed twice

Bautista Solanet [SLC] [DevOps Advocate] Selected answer as best 5 hours ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Jelle Hoorne [SLC] [DevOps Member]282 Posted 6 hours ago 0 Comments

Hi Bautista

IEnumerable<T> is lazy, meaning it doesn’t execute immediately.
The code that produces the values only runs when the sequence is enumerated.

If an IEnumerable is backed by work with side effects (like sending an InterApp message in this case) that work will run every time the sequence is enumerated. This can result in the same request being sent multiple times without it being obvious.

Since you’re seeing the request sent twice, the sequence is being enumerated twice. Common causes are calling .Any() on the collection and then iterating it again with a ForEach() for example.

Without seeing the full code, my best guess is that you first perform an .Any() check on the response collection, and if there are responses, you then iterate over them. That would explain why the request executes twice, and why it only executes once when there is no reply.

To avoid this, don’t expose side-effecting operations as a lazy IEnumerable. Instead, materialize the result before returning it (for example, using ToList() or FirstOrDefault()).

If the intent is “send once, receive all replies, then return them”:

  • Update SendRequest to return a List<Message>

  • Call .ToList() on interAppCall.Send()

If you only ever expect a single reply:

  • Update SendRequest to return a single Message

  • Call .FirstOrDefault() on interAppCall.Send()

Hope this clears things up and fixes the issue.

Bautista Solanet [SLC] [DevOps Advocate] Selected answer as best 5 hours ago
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin