Code Monkey home page Code Monkey logo

message_store's People

Contributors

ondrej-tucek avatar s-m-i-t-a avatar

Watchers

 avatar  avatar  avatar  avatar

message_store's Issues

Data or metadata from the current message must have a higher priority than from the recorded message.

Now:

iex> Message.follow(
  %{
    type: "Test", 
    data: %{foo: 2}, 
    metadata: %{bar: 1}
  }, 
  %{
    correlation_id: "1", 
    event_id: "2", 
    data: %{}, 
    metadata: %{bar: 3}
  }, 
  [:data, :metadata]
)
%EventStore.EventData{
  causation_id: "2",
  correlation_id: "1",
  data: %{foo: 2},
  event_id: nil,
  event_type: "Test",
  metadata: %{bar: 3}
}

Expected:

iex> Message.follow(
  %{
    type: "Test", 
    data: %{foo: 2}, 
    metadata: %{bar: 1}
  }, 
  %{
    correlation_id: "1", 
    event_id: "2", 
    data: %{}, 
    metadata: %{bar: 3}
  }, 
  [:data, :metadata]
)
%EventStore.EventData{
  causation_id: "2",
  correlation_id: "1",
  data: %{foo: 2},
  event_id: nil,
  event_type: "Test",
  metadata: %{bar: 1}
}

Add recipient filter/selector in subscriber.

When is recipient in message metadata and subscriber has recipent set in settings, subsciber react only values match. Resolve problem with concurent consumers and only selected one process the message.

Fetch function must return global position.

Now function return position in selected stream, but subscriber operate above $all stream, then event_number in projection point to stream_version and in subscriber to global position. These values can't be match for message processed check.

Fetch function must be refactored to use same stream $all or use own SQL to get global postion.

Fix origin stream/recipient selector when subscriber has attribute set and messages has not.

GenServer {Goauld.MessageStore.EventStore.Subscriptions.Registry, {"$all", "eu:gemini:components:heartbeat:command"}} terminating
** (FunctionClauseError) no function clause matching in MessageStore.Subscriber.recipient_selector/2
    (message_store 0.4.1) lib/message_store/subscriber.ex:130: MessageStore.Subscriber.recipient_selector("eu:gemini", %EventStore.RecordedEvent{causation_id: "125c5329-63d0-529f-8d4e-6d7b7471e276", correlation_id: "125c5329-63d0-529f-8d4e-6d7b7471e276", created_at: ~U[2020-08-31 12:59:41.992250Z], data: %{addrs: ["192.168.0.14", "fe80::30d6:a08:c12b:427d"], host_name: "gemini", id: "125c5329-63d0-529f-8d4e-6d7b7471e276", location: "eu", time: "2020-08-31T12:59:41.986930"}, event_id: "c5b32b72-f541-48cb-a2a4-ed23fc679540", event_number: 1, event_type: "Register", metadata: %{}, stream_uuid: "hostRegistry:command-125c5329-63d0-529f-8d4e-6d7b7471e276", stream_version: 1})
    (message_store 0.4.1) lib/message_store/subscriber.ex:109: MessageStore.Subscriber.selector/2
    (eventstore 1.1.0) lib/event_store/subscriptions/subscription_fsm.ex:420: EventStore.Subscriptions.SubscriptionFsm.enqueue_events/2
    (eventstore 1.1.0) lib/event_store/subscriptions/subscription_fsm.ex:126: EventStore.Subscriptions.SubscriptionFsm.transition/3
    (eventstore 1.1.0) lib/event_store/subscriptions/subscription.ex:110: EventStore.Subscriptions.Subscription.handle_info/2
    (stdlib 3.13) gen_server.erl:680: :gen_server.try_dispatch/4
    (stdlib 3.13) gen_server.erl:756: :gen_server.handle_msg/6
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: {:events, [%EventStore.RecordedEvent{causation_id: "125c5329-63d0-529f-8d4e-6d7b7471e276", correlation_id: "125c5329-63d0-529f-8d4e-6d7b7471e276", created_at: ~U[2020-08-31 12:59:41.992250Z], data: %{addrs: ["192.168.0.14", "fe80::30d6:a08:c12b:427d"], host_name: "gemini", id: "125c5329-63d0-529f-8d4e-6d7b7471e276", location: "eu", time: "2020-08-31T12:59:41.986930"}, event_id: "c5b32b72-f541-48cb-a2a4-ed23fc679540", event_number: 1, event_type: "Register", metadata: %{}, stream_uuid: "hostRegistry:command-125c5329-63d0-529f-8d4e-6d7b7471e276", stream_version: 1}]}
State: %EventStore.Subscriptions.Subscription{retry_interval: 60000, stream_uuid: "$all", subscription: %EventStore.Subscriptions.SubscriptionFsm{data: %EventStore.Subscriptions.SubscriptionState{buffer_size: 1, conn: Goauld.MessageStore.Postgrex, event_store: Goauld.MessageStore, last_ack: 0, last_received: 0, last_sent: 0, lock_ref: #Reference<0.955217136.1098645505.138139>, mapper: nil, max_size: 1000, partition_by: nil, partitions: %{}, processed_event_ids: #MapSet<[]>, queue_size: 0, registry: EventStore.Registration.LocalRegistry, selector: #Function<2.94935568/1 in MessageStore.Subscriber.init/1>, serializer: MessageStore.JsonSerializer, start_from: 0, stream_uuid: "$all", subscribers: %{#PID<0.517.0> => %EventStore.Subscriptions.Subscriber{buffer_size: 1, in_flight: [], last_sent: 0, partition_key: nil, pid: #PID<0.517.0>, ref: #Reference<0.955217136.1098645505.138087>}}, subscription_id: 1, subscription_name: "eu:gemini:components:heartbeat:command"}, state: :subscribed}, subscription_name: "eu:gemini:components:heartbeat:command"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.