简体   繁体   English

我对SSIS跨进程通信有哪些选择?

[英]What options do I have for SSIS cross-process communication?

I would like to store an integer variable that gets incremented and decremented (a counting semaphore for limiting concurrent requests to an external API). 我想存储一个递增和递减的整数变量(用于限制对外部API的并发请求的计数信号量)。 This would be easy, except I need a way to read/write this variable from an SSIS package that is run in parallel SQL Agent jobs. 这很容易,除了我需要一种从并行SQL代理作业中运行的SSIS包读取/写入此变量的方法。 Right now there can be 0 to 5 instances of the SQL Agent job, and therefore the SSIS package, running at once. 现在,可以有0到5个SQL代理作业实例,因此可以同时运行SSIS包。

What are my options for reading and writing this variable? 我有什么选择来读写这个变量? The code that will be using this variable is written as a custom SSIS task in .NET. 将使用此变量的代码在.NET中编写为自定义SSIS任务。

It is not particularly important that the value is exactly right, as long as it's generally close I'm within a tolerance range. 值完全正确并不是特别重要,只要它通常接近我在公差范围内。 Exact would be great, but not required. 确切很好,但不是必需的。

I have access to the file system, registry, database, server, and the SSIS agent as a whole, but I'd like to check this variable very often by 15-30 threads, which has historically caused issues using a file system method (I'm probably doing it wrong), and is IMO too intensive to store in the database. 我可以访问文件系统,注册表,数据库,服务器和SSIS代理作为一个整体,但我想经常检查这个变量15-30个线程,这在历史上导致了使用文件系统方法的问题(我可能做错了),并且IMO太密集而无法存储在数据库中。 Correct me if I'm wrong. 如果我错了纠正我。 Storing in the registry prevents the variable from being accessible across a server farm. 存储在注册表中可防止变量在服务器场中可访问。

If there's anyone out there that can help, I will gladly be your indentured servant. 如果有人可以提供帮助,我很乐意成为你的契约仆人。

If it is used as counting semaphore, why not actually use Windows semaphore object? 如果它被用作计数信号量,为什么不实际使用Windows信号量对象? System.Threading.Semaphore is .NET version of it, and if you specify the semaphore name in constructor - the Win32 object will be shared between all the processes that use this name. System.Threading.Semaphore是它的.NET版本,如果在构造函数中指定信号量名称 - Win32对象将在使用此名称的所有进程之间共享。

Not sure I understand the question - you indicated you have access to a Database, file system, registry, etc. Are you saying you don't want to / can't use these methods? 不确定我理解这个问题 - 你表示你可以访问数据库,文件系统,注册表等。你是说你不想/不能使用这些方法? Are you looking to persist the value so in the event the computer halts you can recover? 您是否希望保留该值,以便在计算机暂停时您可以恢复?

If persistance is not required, you could persist in memory via an RPC, including COM or web services. 如果不需要持久性,则可以通过RPC(包括COM或Web服务)在内存中保留。 Whatever the solution, it seems it needs to be global and visible to all running instances. 无论解决方案是什么,它似乎都需要全局并且对所有正在运行的实例都是可见的。

Is this variable metadata used as a semaphore to control and coordinate the processes, or is this variable domain data? 这个变量元数据是用作控制和协调进程的信号量,还是这个可变域数据?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM