Receivers

In the context of the Publishing module, receiver is usually a public Magnolia instance that receives content from an author instance.

This page explains how to configure receivers.

About the publishing process

Publishing may refer either to a system process that copies content from an author to public instances or to a user action which triggers the process.

For more information about how publishing works, please refer to the Publishing overview page.

License limitations

  • The Community Edition supports one receiver. You can configure many receivers but only the first receiver will receive published content. The publishing process is handled by the Publishing module itself.

  • DX Core supports many receivers and the process is handled by the Publishing and Publishing Transactional modules.

Verifying publication success

There are three ways to verify successful publication:

  • Status indicator changes to green on the author instance.

  • Page content on the public instance is new. Request the page to test.

  • Publication log /webapps/magnoliaAuthor/logs/magnolia-activation.log contains a success entry. See Monitoring about logging and debugging.

Configuration

Publishing receivers are configured using MicroProfile Config. You can supply MicroProfile configurations using:

  • properties files

  • YAML files

  • system properties or environment variables (and more)

To point to your config file, you must pass the magnolia.config.locations as a system property (for example, using Tomcat VM options in the setenv.sh configuration file), pointing to the directory where your config file resides (for example -Dmagnolia.config.locations=/opt/magnolia/mounted-config).

  • microprofile-config.properties

  • microprofile-config.yaml

magnolia.publishing.receivers[0].name=magnoliaPublic-0
magnolia.publishing.receivers[0].url=http://dev-magnolia-helm-public-0-svc:8080
magnolia.publishing.receivers[1].name=magnoliaPublic-1
magnolia.publishing.receivers[1].url=http://dev-magnolia-helm-public-1-svc:8080
magnolia:
  publishing:
    receivers:
      - name: magnoliaPublic-0
        url: http://dev-magnolia-helm-public-0-svc:8080
      - name: magnoliaPublic-1
        url: http://dev-magnolia-helm-public-1-svc:8080

The default receiver for local development (magnoliaPublic8080) has been removed.

Receiver example for local development
magnolia.publishing.receivers[0].name=magnoliaPublic
magnolia.publishing.receivers[0].url=http://{host}:{port}/magnoliaPublic (1)
1 Put the path magnoliaPublic in the URL for local development.

Previous (Magnolia 6.2) definition in JCR

In Magnolia 6.2, publishing receivers were configured in JCR, under the publishing-core module. This made it difficult to provision instances across multiple environments and configure receivers during installation or startup through various JCR bootstrapping techniques.

Node name Value

📁 modules

     📁 publishing-core

         📁 config

             ⸬ receivers

                 ⸬ magnoliaPublic8080

                     ⬩ url

                     ⬩ enabled

true

Receiver properties

Property Description

name

required

Disambiguating name for a specific receiving public instance.

url

required

Host name (or IP address) and port number of the receiving public instance.

enabled

optional, default is true

Enables or disables the receiver without deleting the setup.

Useful when there are multiple receivers.

connectionTimeout

optional, default is 10000 (10 seconds)

Sets a connection timeout in milliseconds.

If time runs out before a connection to the receiver can be established, a java.net.SocketTimeoutException is thrown. The 0 value is interpreted as an infinite timeout.

readTimeout

optional, default is 600000 (10 minutes)

Sets the read timeout in milliseconds.

If time runs out before the published content is read from the author instance, a java.net.SocketTimeoutException is thrown. The 0 value is interpreted as an infinite timeout.

Receivers can receive any content item: websites, website sections, configuration settings, custom content types, forums, comments, documents, images and so on. For example, you could publish a campaign site to a dedicated public instance.

Troubleshooting receivers configuration

Use the following Groovy script to check your receivers are correctly configured.

import info.magnolia.objectfactory.Components
import info.magnolia.publishing.config.PublishingConfig
import org.eclipse.microprofile.config.Config
import org.eclipse.microprofile.config.ConfigProvider

config=ConfigProvider.getConfig()
println "Raw MP value: " + config.getValue("magnolia.publishing.receivers[0].url", String.class)

// Refreshable only via Guice for now, until MAGNOLIA-9367 standardizes the implementation.
Components.getComponent(PublishingConfig.class).getReceivers().get(0).getUrl()

Workspaces

By default, a publishing receiver configuration will react to all workspaces.

The purpose of these workspace configs is to react to specific workspaces in a more granular way, by excluding or including certain parts of the data.

For each receiver, the specific content to be published or excluded from publishing is configured through properties under the workspaces node.

Example MicroProfile configuration for the website workspace
magnolia.publishing.receivers[0].workspaces[0].workspace=website
magnolia.publishing.receivers[0].workspaces[0].fromPath=/
magnolia.publishing.receivers[0].workspaces[0].toPath=/
magnolia.publishing.receivers[0].workspaces[0].exclude=true

Properties

Property Description

workspace

required

Name of a workspace.

fromPath

required

Workspace path on the author instance from which content is published.

For a single site, enter the site node such as /my-site. To receive content from a particular branch, enter a more precise path such as /my-site/about.

A trailing slash in the path limits the published content to the subnodes:

  • / - Everything

  • /my-site - The /my-site node and everything under it.

  • /my-site/about - The about node and everything under it.

  • /my-site/about/- Content under /my-site/about page but not the node itself.

toPath

required

Workspace path on the public instance to which the content is published.

enabled

optional, default is true

A Node2Bean property that turns the mapping on (true) or off (false).

excluded

optional, default is false

The true setting excludes the configured fromPath from publication.

This property allows you to define exceptions such as "Publish everything in the website workspace except the about node and everything under it."

Example A - Reacting to a workspace partially

The receiver will react to the content in /travel in the website workspace, but will ignore everything else.

magnolia.publishing.receivers[0].workspaces[0].workspace=website
magnolia.publishing.receivers[0].workspaces[0].fromPath=/travel
magnolia.publishing.receivers[0].workspaces[0].toPath=/travel

Example B - Ignoring a workspace partially

The receiver will ignore a specific path, here the /sportstation, but will react to everything else in the website2 workspace.

magnolia.publishing.receivers[0].workspaces[1].workspace=website2
magnolia.publishing.receivers[0].workspaces[1].fromPath=/sportstation
magnolia.publishing.receivers[0].workspaces[1].toPath=/sportstation
magnolia.publishing.receivers[0].workspaces[1].exclude=true

Example C - Ignoring a complete workspace

The receiver will not react at all to the test-website workspace.

magnolia.publishing.receivers[0].workspaces[2].workspace=test-website
magnolia.publishing.receivers[0].workspaces[2].fromPath=/
magnolia.publishing.receivers[0].workspaces[2].toPath=/
magnolia.publishing.receivers[0].workspaces[2].exclude=true

Multiple receivers

In DX Core, the author instance can publish content to multiple receivers. Receivers are key to building high-availability, load-balanced environments since they can be configured to receive targeted content. See Creating a new public instance.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules