Hello! I'm currently using riffed to try and deserialize messages coming in from a kafka stream. I've created a models.ex with:
defmodule Models do
use Riffed.Struct, common_types: [:Location, ...],
event_types:[:Event, ...]
end
My thrift files are compiled from the instructions provided on this github.
My function for converting binary -> Thrift struct (is copied from @scohen here
def to_thrift(record_binary, struct_definition) do
try do
with({:ok, memory_buffer_transport} <- :thrift_memory_buffer.new(record_binary),
{:ok, binary_protocol} <- :thrift_binary_protocol.new(memory_buffer_transport),
{_, {:ok, record}} <- :thrift_protocol.read(binary_protocol, struct_definition)) do
{:ok, Models.to_elixir(record, struct_definition)}
end
rescue e ->
IO.inspect e
{:error, :cant_decode}
end
end
I'm looking at my logs and I keep seeing something like:
Hello! I'm currently using riffed to try and deserialize messages coming in from a kafka stream. I've created a
models.ex
with:My thrift files are compiled from the instructions provided on this github.
My function for converting binary -> Thrift struct (is copied from @scohen here
I'm looking at my logs and I keep seeing something like:
Has anyone run into this kind of error and if so what is the workaround? Thanks!