How to update Akka-typed IoT tutorial to use Akka-http

Hello. I’ve been working through the Akka IoT tutorial and tried to move on to work with the quickstart guide for Akka http. When working with the IoT tutorial, I had been advised that if I want to send the ReadTemperature message to the Device Actor, I should do so directly rather than through its ancestor actor. However, when trying to set up a route that will read the temperature of a device with a device id, it’s hard for me to find how I’d go from a /device/temperature?id=foo endpoint straight to the device. I was wondering if there’s an example of how this can be achieved or of any reasonable architecture. Thanks.

Hi, I think that it may be hard to get around going through the DeviceManager, so if there is such a recommendation in the docs it may be a leftover from porting the quickstart from the old “classic” actor APIs where you can look an actor up through its path. If you could point us to where it says this we’ll see if we can rephrase.

Such a design could end up with the DeviceManager and or DeviceGroup being a bottleneck in a high throughput scenario since all messages to devices would have to go through its mailbox. But considering that you are likely doing this to learn the basics of the Akka libraries that may not be the most important problem to solve but rather getting the puzzle pieces to fit with each other to start with.

You can always revisit that aspect later when you have learned more.