Expand my Community achievements bar.

SOLVED

Automatically publish content from Master-Publish instance in Asset Offloading

Avatar

Level 5

Hi All,

We have implemented Asset offloading approach i.e Author instance (Master). Now Slave instance replicate back processed content to Master instance as per Offloading approach.

Now we want to replicate the content that got reflected in Master instance to Publisher.

Observed that replication is not happening on Master instance to Publisher after Slave instance completes its replication back to Master.

Could you any provide any points on this.

Thanks

Sailaxman

1 Accepted Solution

Avatar

Correct answer by
Employee

It's not a perfect approach, however, it works on my test env. Not sure, what is your real business case; you might need to revisit and improve the launch configuration.

Event Type : Modified,

Node Type : dam:Assets

Path : /content/dam(/.*)

Workflow : Your custom WF

Exclude LIst: cr:lastModified,dc:modified,jcr:lastModifiedBy,imageMap,event-user-data:changedByWorkflowProcess,dam:extracted,simsearchVersion,jcr:lastModified,dc:modified,dc:format,jcr:lastModifiedBy,imageMap,dam:scene7(.*),event-user-data:changedByWorkflowProcess

Run Mode(s) : Author

1833043_pastedImage_9.png

View solution in original post

18 Replies

Avatar

Employee

Hello Sailaxman,

What do you mean by replication not happening? Are you using the normal author-publish replication queue? Do you see any errors in logs? Can the replication agents replicate the other content like pages etc? Did you try to manually replicate the assets?

Regards,

Vishu

Avatar

Employee

@sailaxmanr83887909 Are you expecting for assets to automatically get published?  This is not by design.  Assets will publish when a user clicks to Activate it or activate a page with assets in it. 

Avatar

Level 5

Hi Vish.dhaliwal,

Yes manual replication is happening if we trigger it on Master instance, but it should happen automatically as soon slave instance replication completes to Master.

Thanks

Sailaxman

Avatar

Level 5

@yanirac19051392

So you mean to say we cant publish content automatically only way to do is Manually ?

Avatar

Employee

In this case, it has to be manual. There are different replication triggers though. Please review [1] and check which one fits your use case.

You may also create a custom workflow to replicate these assets as soon as they upload back in master.

[1] Replication

Avatar

Employee

Can you explain the business usecase/need?  Why is there a need to automatically publish all assets that are uploaded to the instance (master)?

Asset offloading is designed to unburden the master instance from heavy asset ingestion.  It's doesn't come into play with activation of assets. 

Avatar

Employee Advisor

I agree with Yanira's response, This is not by design.  Assets will publish when a user clicks to Activate it or activate a page with assets in it.

You need to think of author and publish as two entities and offloading in only implemented on the author with no trigger/process predefined to automatically replicate the content to publish.

That said, You can create a launcher from workflows that triggers a Replicate asset workflow on modification of "dam:Asset" on the master instance and that will replicate any assets that are being modified on the master to publish instance. You can read more about launchers at [1]

[1] Starting Workflows

Avatar

Employee

You can run a test with a modified OOTB DAM UPDATE ASSET OFFLOADING, you can simply add Activate Page/Asset step:

1831249_pastedImage_0.png

Avatar

Level 5

Thanks all for the inputs provided will try above approaches suggested.

Avatar

Level 5

@ Berliant,

Tried update as suggested DAM Update Asset Offloading workflow, but things didn't work out as expected.

Asset is getting replicated to Publisher as soon as it uploads to Master instance i.e before creation of renditions.

Throwing exceptions like "com.day.cq.dam.core.impl.AssetImpl getMetadataValue: metadata node does not exist for asset",

"SlingRequestProcessorImpl service: Uncaught SlingException java.lang.NullPointerException: null" etc.

Could any one suggest any other ways for publishing content to publisher as soon as Offloading of renditions on Master is complete.

Avatar

Employee

You can try to create an additional workflow launcher and set a trigger to when metadata for an asset is created.

Avatar

Level 5

Yes created a custom workflow launcher and did. It is getting published to Publisher but with no metadata node on asset.

Event Type : Created, Node Type : nt:unstructured, Path : /content/dam(/.*)/jcr:content/metadata,

Run Mode(s) : Author & Publish, Conditions : dc:format!=,

Workflow : Scheduled Page/Asset Activation

Tried few diff scenarios as well but not working as expected. Any pointers here.

Avatar

Employee

AEM offloading workflow creates "jcr:content/metadata" node. The node is empty up until a worker extracts and sends metadata to the master.

1832840_pastedImage_0.png

Can you test with "Modified event" and set Run Modes to Author only.

Avatar

Level 5

Hi, yes metadata node is created after changing event type to 'Modified',but observed that workflow instances are created & getting triggered continuously at the back-end & publishing it to instance. Also thumbnails are not generated in renditions folder(only original is available).

Avatar

Employee

Do you mean that offloading (the worker instance) does not send rendition and metadata back to the master? Despite the Publishing process, does offloading topology work?

Avatar

Level 5

Yes offloading is working perfectly fine with all metadata & renditions to Master but replication from Master to Publisher is happening with out Renditions.

Could you share details to be mentioned in launcher in each param that would be available on Master.

Avatar

Correct answer by
Employee

It's not a perfect approach, however, it works on my test env. Not sure, what is your real business case; you might need to revisit and improve the launch configuration.

Event Type : Modified,

Node Type : dam:Assets

Path : /content/dam(/.*)

Workflow : Your custom WF

Exclude LIst: cr:lastModified,dc:modified,jcr:lastModifiedBy,imageMap,event-user-data:changedByWorkflowProcess,dam:extracted,simsearchVersion,jcr:lastModified,dc:modified,dc:format,jcr:lastModifiedBy,imageMap,dam:scene7(.*),event-user-data:changedByWorkflowProcess

Run Mode(s) : Author

1833043_pastedImage_9.png

Avatar

Level 5

Thanks Berliant..it works & assets are getting published with renditions.