微服务架构依赖(Microservice Architecture dependency)
我已经阅读了很多关于微服务架构的内容,但有一件事我不明白如何实现并希望你可以帮助我...
假设我有一个web-api-endpoint,它接收OrderMicroservice负责处理的命令。 当订单被放置时,必须更新库存,以便OrderMS向订户发布事件(使用例如Nats的pub / sub),而InventoryMS将更新库存,因为它订阅当前事件/消息....我想要松散耦合架构并使用asynch调用对给定信息感兴趣的模块/ MS。
如果您有1个InventoryMS实例,那么情况将完全正常但如果您横向扩展了InventoryMS会发生什么情况,即有5个InventoryMS实例并且他们都订阅inventory.change.event并将尝试更新库存?
我应该使用什么样的架构或消息模式来实现这样的场景,因为我可以在MS彼此依赖时使用松耦合架构? 一种方式是通过使用断路器模式的REST调用在内部进行通信,但后来我觉得我构建了具有一定智能性的断路器(断路器)......
谢谢你的帮助!
I have read a lot about microservice architecture but there is one thing that I dont understand how to achieve and hope you can help me with this...
Lets say I have a web-api-endpoint that recieves orders that an OrderMicroservice is responsible to handle. When order is put Inventory must be updated so OrderMS publish an event to subscribers (pub/sub using for example Nats) and InventoryMS will update the inventory due to it is subscribing to current event/message....I want to have a loose coupled architecture and use asynch calls to modules/MSs thats are interested in given info.
Given scenario will work perfectly fine if you have 1 instance of InventoryMS but what happens if you have scaled the InventoryMS horizontally i.e there are 5 instances of InventoryMS and all of them subscribes to inventory.change.event and will try to update the inventory?
What kind of architecture or message pattern should I use for a scenario like this with horizonatally scalled MS's so I can have a loose coupled architecture when MSs are dependent of each other? One way is that communication internally is made by REST-calls using circuit breaker pattern but then I feel that I build a monolite of MSs with some smartness (the circuit breaker)...
Thanks for your help!
原文:https://stackoverflow.com/questions/43378165
满意答案
您可以使用
SqlCommand.CommandTimeout = 0; //0 is for unlimited
或者您可以使用预处理器指令仅用于调试目的,请参阅此处http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.71).aspx和此处C#中的预处理器指令是一些细节。
You can use
SqlCommand.CommandTimeout = 0; //0 is for unlimited
Or you can use pre-processor directives just for debugging purpose see here http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.71).aspx and here Pre-Processor directives in C# are some details.
相关问答
更多MySQL存储过程调试(MySQL stored procedure debugging)
BIDS SSRS在使用存储过程时报告查询超时问题,同时适当设置超时设置(BIDS SSRS Report query timeout issue while using Stored Procedure with timeout settings set appropriately)
SQL Server 2008存储过程突然返回-1(SQL Server 2008 Stored Proc suddenly returns -1)
在SQL Server 2008 Management Studio中调试存储过程(Debugging stored procedure in SQL Server 2008 Management Studio)
在MS SQL Server 2008中为AES加密创建存储过程(Create a Stored Procedure for AES Encryption in MS SQL Server 2008)
用vs 2008调试?(debugging with vs 2008?)
使用Alter命令的Oracle存储过程(Oracle Stored Procedure with Alter command)
使用VS 2008调试存储过程时获取命令超时(Getting Command Timeout while debugging Stored Procedure with VS 2008)
在SQL Server 2008中的存储过程中导出为CSV(Export to CSV in stored procedure in SQL Server 2008)
在存储过程调用上获取超时(Getting Timeout on stored procedure call)
相关文章
更多Solr Architecture[转]
Stack Overflow Architecture Update - Now At 95 Million Page Views A Month
sbt添加依赖库
Yupoo网站架构学习总结(转)
Solr搜索服务架构图
分散处理 Hadoop架构服务器角色分工
JFreeChart架构详解
微信架构的启示
国内图片网站Yupoo的架构
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!