Kentico 9 scheduled task not syncing media - kentico

I know there are upper limits on file size when it comes to media, but i'm testing with small images.
If i change a page, a simple content changed, the scheduled task syncs the change and i can see the update on the target server. If i upload an image to the media library, it doesn't sync via the scheduled tasks. I can sync it manually though.
I've read through the documentation, and didn't see anything where media files wouldn't sync, just the exact opposite though.
So what am i missing to get media files to sync?

It's beacuse the scheduled task synchronizes only page changes. You cannot use the default Content synchronization task to synchronize other objects.
But you can use event handlers and some API to synchronize any type of staging task.
https://docs.kentico.com/display/K9/Automatically+synchronizing+staging+and+integration+tasks

Related

Google Cloud: Choosing the right storage option

I am developing a distributed application in Python. The application has two major packages, Package A and Package B that work separately but communicate with each other through a queue. In other words Package A generates some files and enqueue (pushes) them to a queue and Package B dequeues (pops) the files on a first-come-first-service basis and processes them. Both Package A and B are going to be deployed on Google Cloud as docker containers.
I need to plan what is the best storage option to keep the files and the queue. Files and the queue could be stored and used temporarily.
I think that my options are Cloud buckets or Google datastore, but have no idea how to choose from and what could be the best option. The best option would be a solution that has a low cost, reliable and easy-to-use from the development aspect.
Any suggestion is welcome... Thanks!
Google Cloud Storage sounds like the right option for you because it supports large files. You have no need for features provided by datastore etc such as querying by other fields.
If you only need to process a file once, when it is first uploaded, you could use GCS pubsub notifications and trigger your processor from pubsub.
if you need more complex tasks, e.g. one task can dispatch to multiple child tasks that all operate on the same file, then it's probably better to use a separate task system like celery and pass the GCS URL in the task definition.

Suspended changesets created in Dev workspace appear in Release workspace

Here's my setup: I have a SW_Dev stream which is loaded in SW_Dev_RWS workspace. This is where the daily work is done. Every once in a while, I make a snapshot of SW_Dev, and create a workspace from that snapshot, SW_Release_v1_RWS. Then I change the flow target of SW_Release_v1_RWS to SW_Release stream deliver all changes there and also make a snapshot. The goal is to have snapshots for all releases in SW_Release stream. I also keep SW_Release_v1_RWS loaded for a while, since I often need to produce release binaries with small tweaks for testing.
The problem I have appears when I have unfinished work in SW_Dev which I have to store in a suspended changeset. For some reason, that suspended changeset also appears (as suspended) in SW_Release_v1_RWS. Of course that means there are no actual modifications to the release workspace, but it doesn't look tidy. What's worse, if I try to discard a suspended changeset from SW_Release_v1_RWS, it also disappears from SW_Dev_RWS.
Is there a way to prevent suspended changesets created in SW_Dev_RWS from appearing in SW_Release_v1_RWS? Perhaps there is a different approach I should adopt for saving release snapshots in SW_Release stream?

Content does not contain updates

We use Contentful's webhook for triggering an external build process. Every now and then we notice, when this webhook is fired after publishing content changes, these changes are not visible after the build is finished. In these cases we have to start the process manually which fixes the issue.
According to Contentful, since the delivery API is powered by a CDN, it takes some time (up to 5 minutes) to reflect changes.
Is it possible to flush/invalidate the content first before downloading the content from Contentful. Or is the content available through another url i.o. cdn.contentful.com and give me the 'original' content?
There's no way to flush the caches faster, because that process is already in progress after changing your content — it simply takes some time.
What you could do, is using the Content Management API to fetch the content, but you have to keep two things in mind:
There's a much stricter rate limit in place for the CMA
You will also receive unpublished content when using the CMA
The CMA also has only limited querying capabilities, see https://www.contentful.com/developers/docs/references/content-management-api/#/reference for the full documentation.

Multiple instances of continuous Webjob on single VM in Azure

I have a continuous Webjob running on my Azure Website. It is responsible for doing some work after retrieving items from a QueueTrigger. I am attempting to increase the rate in which the items are processed off the Queue. As I scale out my App Service Plan, the processing rate increases as expected.
My concern is that it seems wasteful to pay for additional VMs just to run additional instances of my Webjob. I am looking for options/best practices to run multiple instances of the same Webjob on a single server.
I've tried starting multiple JobHosts in individual threads within Main(), but either that doesn't work or I was doing something wrong... the Webjob would fail to run due to what looks like each thread trying to access 'WebJobSdk.marker'. My current solution is to publish my Webjob multiple times, each time modifying 'webJobName' slightly in 'webjob-publish-settings.json' so that the same project is considered a different Webjob at publish time. This works great so far, expect that it creates a lot of additional work each time I need to make any update.
Ultimately, I'm looking for some advice on what the recommended way of accomplishing this would be. Ideally, I would like to get the multiple instances running via code, and only have to publish once when I need to update the code.
Any thoughts out there?
You can use the JobHostConfiguration.QueuesConfiguration.BatchSize and NewBatchThreshold settings to control the concurrency level of your queue processing. The latter NewBatchThreshold setting is new in the current in progress beta1 release. However, by enabling "prerelease" packages in your Nuget package manager, you'll see the new release if you'd like to try it. Raising the NewBatchThreshold setting increases the concurrency level - e.g. setting it to 100 means that once the number of currently running queue functions drops below 100, a new batch of messages will be fetched for concurrent processing.
The marker file bug was fixed in this commit a while back, and again is part of the current in progress v1.1.0 release.

WF4 Affinity on Windows Azure and other NLB environments

I'm using Windows Azure and WF4 and my workflow service is hosted in a web-role (with N instances). My job now is find out how
to do an affinity, in a way that I can send messages to the right workflow instance. To explain this scenario, my workflow (attached) starts with a "StartWorkflow" receive activity, creates 3 "Person" and, in a parallel-for-each, waits for the confirmation of these 3 people ("ConfirmCreation" Receive Activity).
I then started to search how the affinity is made in others NLB environments (mainly looked for informations about how this works on Windows Server AppFabric), but I didn't find a precise answer. So how is it done in others NLB environments?
My next task is find out how I could implement a system to handle this affinity on Windows Azure and how much would this solution cost (in price, time and amount of work) to see if its viable or if it's better to work with only one web-role instance while we wait for the WF4 host for the Azure AppFabric. The only way I found was to persist the workflow instance. Is there other ways of doing this?
My third, but not last, task is to find out how WF4 handles multiple messages received at the same time. In my scenario, this means how it would handle if the 3 people confirmed at the same time and the confirmation messages are also received at the same time. Since the most logical answer for this problem seems to be to use a queue, I started looking for information about queues on WF4 and found people speaking about MSQM. But what is the native WF4 messages handler system? Is this handler really a queue or is it another system? How is this concurrency handled?
You shouldn't need any affinity. In fact that's kinda the whole point of durable Workflows. Whilst your workflow is waiting for this confirmation it should be persisted and unloaded from any one server.
As far as persistence goes for Windows Azure you would either need to hack the standard SQL persistence scripts so that they work on SQL Azure or write your own InstanceStore implementation that sits on top of Azure Storage. We have done the latter for a workflow we're running in Azure, but I'm unable to share the code. On a scale of 1 to 10 for effort, I'd rank it around an 8.
As far as multiple messages, what will happen is the messages will be received and delivered to the workflow instance one message at a time. Now, it's possible that every one of those messages goes to the same server or maybe each one goes to a diff. server. No matter how it happens, the workflow runtime will attempt to load the workflow from the instance store, see that it is currently locked and block/retry until the workflow becomes available to process the next message. So you don't have to worry about concurrent access to the same workflow instance as long as you configure everything correctly and the InstanceStore implementation is doing its job.
Here's a few other suggestions:
Make sure you use the PersistBeforeSend option on your SendReply actvities
Configure the following workflow service options
<workflowIdle timeToUnload="00:00:00" />
<sqlWorkflowInstanceStore ... instanceLockedExceptionAction="AggressiveRetry" />
Using the out of the box SQL instance store with SQL Azure is a bit of a problem at the moment with the Azure 1.3 SDK as each deployment, even if you made 0 code changes, results in a new service deployment meaning that already persisted workflows can't continue. That is a bug that will be solved but a PITA for now.
As Drew said your workflow instance should just move from server to server as needed, no need to pin it to a specific machine. And even if you could that would hurt scalability and reliability so something to be avoided.
Sending messages through MSMQ using the WCF NetMsmqBinding works just fine. Internally WF uses a completely different mechanism called bookmarks that allow a workflow to stop and resume. Each Receive activity, as well as others like Delay, will create a bookmark and wait for that to be resumed. You can only resume existing bookmarks. Even resuming a bookmark is not a direct action but put into an internal queue, not MSMQ, by the workflow scheduler and executed through a SynchronizationContext. You get no control over the scheduler but you can replace the SynchronizationContext when using the WorkflowApplication and so get some control over how and where activities are executed.

Resources