Added User Lookup Service to Broker
We have made some amazing progress in the past few days with the greek engine we're building. For the first time in this project, I feel like it's really coming together. So much so that I was willing to do a little extra for a group that's trying to use our erlang-based Broker to replace the previous version written in Java. The problem revolve around the fact that they needed to be able to look up the user's authentication data based on the 128-bit auth token that the login service generated. Kind of like a "reverse-login".
The problem was that they were going directly to the mongoDB database where this data was stored, and when they tried to look things up by the 128-bit token, it was byte-ordered differently than expected. This was a problem, but not a horrible one. Still... if I had the time, and it seemed I did, it sure would be a nice thing to write them a service that did this for them so they didn't have to hit the database directly, and didn't have to worry about the byte ordering.
So I did.
Interestingly, it was only about 10 lines of erlang to add to the login service. Where the problems arose was in the encoding/decoding of the data to make it "fit" in with the rest of the serialized data. Times, it seems, weren't really being handled well, and that's understandable, so I had to fix that up before I was getting useful values out.
Then I had to mess with the offset. Originally, we used milliseconds since epoch, as it's pretty universal. But when the high-frequency guys wanted to get in on the act, they wanted microseconds since epoch as their stuff happened a little faster than that. So I had to make sure we had the offset right. Once fixed, we were ready to go.
Almost.
Seems the decoded data on the Java side is not giving us the right date. It's a date, but it's not the right date. I've handed this off to a guy in the group, as I'm convinced that we're sending the correct data - it's just not being delt with my the java client. We'll see what he comes back with.
But it was nice to do a little extra, and help out the adoption of the Broker. It's pretty nice stuff.