首页 \ 问答 \ 微服务架构依赖(Microservice Architecture dependency)

微服务架构依赖(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
更新时间:2024-01-08 13:01

最满意答案

您可以使用

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.

相关问答

更多
  • 不幸的是,似乎没有任何自由选择。 Illatis Stepin是一款基于Eclipse的IDE,用于调试存储过程。 价格是每个许可证40美元。 还有MySQL调试器 ,每个头50美元。 但是,如果您有博客,MyDebugger会提供许可证 - 您可以获得许可证以获取有关该产品的博客。 调试器是否用于开源项目? 如果是这样,您可以尝试联系发布商,看看他们是否会授予您许可证,或许可以在您的项目页面上提及。 如果是用于商业开发,您可能会尝试获得$ 40-50许可费用的批准。 调试器可能会为您节省数小时的时间,因此 ...
  • 在你的rsreportserver.config文件中检查Add Key =“DatabaseQueryTimeout”Value =“120”的值。 你可能还需要在那里增加它。 有关该文件的更多信息: http://msdn.microsoft.com/en-us/library/ms157273.aspx 此外,除了您的帖子中的第一位评论者所说的内容外,根据我的经验,如果您要渲染为PDF,那么也可以超时。 您的大型数据集将返回合理的时间量,但PDF的呈现可能会持续一段时间。 尝试渲染到Excel。 BI ...
  • ExecuteNonQuery将返回受INSERT,UPDATE或DELETE操作影响的行数,而不是存储过程的返回值。 如果它在过去工作,您的查询是否有可能修改数据? 要获取存储过程的返回值,请使用ParameterDirection.ReturnValue向命令添加参数。 在调用ExecuteNonQuery()之后,将使用存储过程的返回值填充该参数。 ExecuteNonQuery will return the number of rows affected by an INSERT, UPDATE ...
  • 只需编写一个正确调用SP的查询并调试: exec MySP p1 p2 etc Just write a query that correctly invokes your SP and debug that: exec MySP p1 p2 etc
  • 好吧,所以我设法说服DBA将数据传输到varbinary(max)数据类型的新列。 然后,我在将这些值加密后将这些值转移到新列中,然后删除旧列并将新列更名为旧名。 做了一些工作,但现在一切正常。 我设法创建了一个存储过程和两个函数来进一步模块化脚本。 打开对称密钥 CREATE PROCEDURE sp_OpenEncryptionKeys AS BEGIN SET NOCOUNT ON; BEGIN TRY OPEN SYMMETRIC KEY Enc ...
  • 请确保您将默认的“托管代码”更改为“托管代码”。 这让我几次。 Make sure you change Attach To to Script from the default which is Managed Code. This got me a few times.
  • 这里有几个可能性。 首先,你必须将SQL视为动态SQL。 其次,Oracle DDL语句不能在事务中运行(或者,它们终止当前事务并且不能自己回滚)。 这可能会影响您是否可以在存储过程中使用它们,或者可以使用包含它们的存储过程。 如果以上都不适用 - 可能很容易出现别的错误 - 我建议发布一些代码。 Here are a couple of possibilities. First, you would have to treat the SQL as dynamic SQL. Second, Oracle ...
  • 您可以使用 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-pro ...
  • 您看到“查询输出附近的语法不正确”。 这是一个T-SQL错误消息。 正如你所说,你是在存储过程中运行它。 BCP和SQLCMD都是命令行实用程序,这意味着您必须从命令(DOS)提示符运行它们。 有一种直接从SQL执行的方法,但你必须使用: xp_cmdshell这是一篇关于如何使用它的好文章: https://www.mssqltips.com/sqlservertip/1633/simple-way-to-export-sql-server-data-to-text-files/ 这是为SQL Serve ...
  • 我已经解决了它改变程序的TimeOut时间(默认为30秒)。 发生这种情况是因为在服务器上直接执行SP与在作业中执行SP不同。 I've solved it changing the TimeOut time of the procedure (which was of 30 secs by default). This happens because it isn't the same to execute a SP directly on the server than in the job.

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)