event-driven-design

MassTransit: Message contracts, polymorphism and dynamic proxy objects

喜夏-厌秋 提交于 2019-12-25 04:18:09
问题 TL;DR On contract subscription, how can I get the raw message content or the original published object, rather than a dynamic proxy? I am having a bad time trying to create a modular application based on MassTransit. My idea is to have a Websocket server connected to queue, it reads events from the socket and inserts it in the queue as a "connection request", and reads events from the queue and send them to the sockets as "connection events". Both have a contract that allows the WS server

Unity GUI Button - Polling Input VS Event Driven Input

心已入冬 提交于 2019-12-20 07:01:33
问题 I am learning Unity with C# and studying the GUI Button. I found the following statement in Unity documentation: "This means that your OnGUI implementation might be called several times per frame (one call per event). " using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 100), "I am a button")) print("You clicked the button!"); } } My questions are: 1) The above "if" statement will keep detecting the

Unity GUI Button - Polling Input VS Event Driven Input

♀尐吖头ヾ 提交于 2019-12-20 07:01:05
问题 I am learning Unity with C# and studying the GUI Button. I found the following statement in Unity documentation: "This means that your OnGUI implementation might be called several times per frame (one call per event). " using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 100), "I am a button")) print("You clicked the button!"); } } My questions are: 1) The above "if" statement will keep detecting the

best practices for handling UI events

こ雲淡風輕ζ 提交于 2019-12-18 03:38:06
问题 I have put the all the binding code for UI events on OnCreate(). It has made my OnCreate() huge. Is there pattern around implementing UI events in android ? Can I add methods in View xml file and then I can put all the handler code somewhere else. In a nutshell , I think I am asking how can I implement MVVM pattern with android app code ? 回答1: Stuff that I do: Keep all onClick functions in the XML. Avoids a lot of clutter in the Java code. Initialize event listeners as members of the activity

Dealing with exceptions in an event driven world

大兔子大兔子 提交于 2019-12-14 03:59:58
问题 I'm trying to understand how exceptions are handled in an event driven world using micro-services (using apache kafka). For example, if you take the following order scenario whereby the following actions need to happen before the order can be completed. 1) Authorise the payment with the payment service provider 2) Reserve the item from stock 3.1) Capture the payment with the payment service provider 3.2) Order the item 4) Send a email notification accepting the order with a receipt At any

What are some Servlet Container for Netty

三世轮回 提交于 2019-12-13 07:09:15
问题 I wanted to build myself a Web based chat application (something like hipchat or facebook chat)I think netty is the way for this since it is event driven, However. Netty does not have any servlet container. So How do I build my own servlet container for netty? or better yet how do you build your own ServletContainer? 回答1: Perhaps Netty is too low level for what you are trying to accomplish. If you want an embedded solution in which servlets can be executed, why not trying Jetty instead? http:

When using MDA, should you differentiate between idempotent and non-idempotent event handlers?

て烟熏妆下的殇ゞ 提交于 2019-12-13 00:57:43
问题 The question assumes the use of Event Sourcing. When rebuilding current state by replaying events, event handlers should be idempotent. For example, when a user successfully updates their username, a UsernameUpdated event might be emitted, the event containing a newUsername string property. When rebuilding current state, the appropriate event handler receives the UsernameUpdated event and sets the username property on the User object to the newUsername property of the UsernameUpdated event

What tools to use on documenting event schema

情到浓时终转凉″ 提交于 2019-12-11 17:22:17
问题 Our team is starting to implement event driven designs. We are now figuring what's the best tool/s and practices for documenting the schema of these events. What are the common tools used for this use case? Any links or suggestions is appreciated. 回答1: I would start off with the common CloudEvents spec and model my events based on that, i.e., define the events as subtypes of the generic CloudEvent model. The benefit here is interoperability with other systems based on the same spec as well as

Listening on multiple events

给你一囗甜甜゛ 提交于 2019-12-11 12:45:11
问题 How to deal with correlated events in an Event Driven Architecture? Concretely, what if multiple events must be triggered in order for some action to be performed. For example, I have a microservice that listens to two events foo and bar and only performs an action when both of the events arrive and have the same correlation id. One way would be to keep an internal data structure inside the microservice that does the book keeping and when everything is satisfied an appropriate action is

Event driven architecture…infinite loop

心不动则不痛 提交于 2019-12-10 12:44:15
问题 I have an event driven architecture where A is waiting for a change from B and B is waiting for a change from C and C is waiting for a change from A, forming a cycle. Now, if B changes, then A fires an event to C, which fires to B, which fires to A, which fires to C...ad infinitum. I can change my program right now to not contain this cycle, but I am concerned I may put myself into a corner at a later time where I cannot. How does one keep such things from happening when designing event based