How ConfigCat webhooks would work in application running behind load balancer? - polling

There are 4 instances of an application running behind a load balancer. How the ConfigCat webhook would work in this case? Do we need to configure 4 public URL's for all 4 servers in webhook settings?

Could you share some details about your use case? What would you like to achieve with webhooks? What kind of SDK are you using? What is the polling mode?
If you want to refresh the SDK's cache on Feature Flag value changes, you should consider using a distributed cache implementation (e.g. redis). Example custom cache in Java: https://configcat.com/docs/sdk-reference/java#custom-cache
If you implement a custom distributed cache, you'll only need to add your load balancer's url to the webhook because refreshing the cache in one instance will refresh the cache in the distributed cache so all of your instances could work with the latest configurations.
If you want to get notified about changes in each applications, there are different possibilities:
You can configure 4 public urls and use the webhooks just like you mentioned it.
If you are using auto polling mode, you can skip the webhooks part and start using the SDK's built-in configuration changed callbacks. e.g. in java: configurationChangeListener part at https://configcat.com/docs/sdk-reference/java#auto-polling-default. When the auto poll mode's polling happens the SDK detects if the configuration changed and it fires this event.
If you could share more details I could help you more.
Disclaimer: I am one of the founders of ConfigCat.

Related

Background service in ServiceStack

I've got an application w. AppHost (inside Startup.cs) and also a Configure.Db.cs file.
I want to run a background service (Timer based) to routinely do some things, in addition to serving services.
If I add the timer inside Apphost's Configure(), which is run before the Configure.Db, I get into a problem as the background service is dependent on the Db to be configured.
Edit: I just found that it is possible to specify order of Modular startup: https://docs.servicestack.net/modular-startup#modular-startup-prioritization which means I can force the Configure.db to run before Apphost.
Anyway, am I going about this wrong? Should I perhaps have a separate AppHost just for the background job?
I would recommend configuring a Background MQ Service for executing Services in the background.
You can look at how to do this with hangfire by adding the mix
x mix hangfire-postgres
This will allow you to add services that fire in the background on a cron schedule.
To make it work without a database you need to change the postgres provider to the in-memory provider: https://github.com/perrich/Hangfire.MemoryStorage

What is the production deployment / runtime architecture of ResolveJS backend systems?

Does the reSolveJS generally run as a single NodeJS application on the server for production deployment?
Of course, event store and read models may be separate applications (e.g. databases) but are the CQRS read-side and write-side handled in the same NodeJS application?
If so, can / could these be split to enable them to scale separately, given the premise of CQRS is that the read-side is usually much more active than the write-side?
The reSolve Cloud Platform may alleviate these concerns, given the use of Lambdas that can scale naturally. Perhaps this is the recommended production deployment option?
That is, develop and test as monolith (single NodeJS application) and deploy in production to reSolve Cloud Platform to allow scaling?
Thanks again for developing and sharing an innovative platform.
Cheers,
Ashley.
reSolve app can be scaled as any other NodeJS app, using containers or any other scaling mechanisms.
So several instances can work with the same event store, and it is possible to configure several instances to work with the same read database, or for every instance to have its own read database.
reSolve config logic is specified in the app's run.js code, so you can extend it to have different configurations for different instance types.
Or you can have the same code in all instances and just route command and queries to the different instance pools.
Of course, reSolve Cloud frees you from these worries, in this case you use local reSolve as dev and test environment, and deploy there.
Please note that reSolve Cloud is not yet publicly released. Also, local reSolve can not have all required database adapters at the moment, so those yet to be written.

Is it possible to create a mobile agent that uses Node.js?

My aim is to create a mobile agent written in Node.js that will perform data collection on each node that is part of the mobile agent platform. If any anomalous events are detected then this is reported back to the control server. The mobile agent will follow a predefined path, saving its state and transferring to another nodes once its task is complete. Are there any frameworks or existing projects that would be suitable for this?
The Java Aglet project is similar to my needs however is obviously only available for Java.
As there was no current solution/package, I have created and now maintain the mobile-agent-platform NPM package.
"A JavaScript Mobile Agent Platform that allows an agent to migrate across a network. A Supervisor node dispatches the Agent which can then autonomously move between Worker nodes, carrying/transferring its state and methods to the new node."
Note: the stack and program counter cannot be transferred due to limitations within Node.js.

Creating a task (push) queue programmatically in google app engine using python/flask

The docs on this aren't great. Really I want to find a way to create a task queue programmatically if it does not already exist without having to install the google cloud package locally and deploying a yaml that specifies the queues.
The short answer: this is not possible, at least not at this time.
The only way to create/update a task queue configuration, at least presently, is to deploy a queue configuration file with the corresponding information. From Creating Push Queues:
To add queues or change the default configuration, edit the
queue.yaml file for your application, which you upload to App
Engine.
This can be scripted, qualifying in a sense as being done programmatically. See related Create TaskQueue programmatically
Technically (but most likely not what you're after) deploying the queue configuration file can also be done with a GAE language specific SDK, not only with the google cloud (gcloud) SDK.
Side note: you tagged your post with python-3.x, which is only supported in the flexible environment, you should be aware of the Task Queue limitations in such case.

SignalR thinks request is cross domain

We faced an issue in our staging environment where SignalR thought the request was coming from another domain. So, we enabled CORS for the time being...however, we realized that we were downgraded to long polling which means we can't maintain server affinity.
We are using .NET 4 / SignalR 1.2.2 and our request goes through an F5 load balancer. We're trying to debug this issue, obtain logs and disable CORS to get exact details. I tried to map a hub with "http://domainname.com/signalr", but it didn't work. The application lanuched without complaining, but I couldn't connect to signalr anymore. Since we're on .NET 4, we can't move to using the latest version / WebSockets.
What is the best way to instruct SignalR to allow a range of domains? (I've also tried multiple calls to map hubs, but that failed).
UPDATE:
Upon further investigation, I've realized that that the application can be accessed internally and externally. SignalR seems to bind to the machine name. Hence, everything works on the local url. However, when we make a request from an external domain which the F5 load balancer forwards, SignalR thinks it's a cross-site request....which theoretically it isn't in this case.
Is it possible that this is a F5 issue?
Is there a way to ask SignalR to allow certain domains without downgrading to longPolling?
If you've implemented load balancing then you must implement scale out in SignalR
take a look at ScaleOut in SignalR
One approach is ScaleOut with SQL Server : Have a look

Resources