Page tree
Skip to end of metadata
Go to start of metadata

Subscriber is a public Magnolia instance that receives content from an author instance. This page explains how to configure subscribers and subscriptions.

About the publishing process

The technical Magnolia term for publishing is activation but for all practical purposes publishing and activating are synonymous. Activation is the system process that copies content from an author to public instances whereas publishing is triggered by the user.

License limitations

  • Community Edition supports one subscriber. You can configure many subscribers but only the first subscriber will receive published content. Publishing is handled by the Exchange Simple module.
  • Enterprise Edition supports many subscribers. Publishing is handled by the Transactional Activation module.

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.
  • Activation log /webapps/magnoliaAuthor/logs/magnolia-activation.log contains a success entry. See Monitoring about logging and debugging.

Configuration

Subscriber configuration is in Configuration > /server/activation/subscribers. Here you define the address of the subscriber and the type of content it should receive. In the default setup, the public instance is configured as a subscriber of the author instance.

Subscribers

A subscriber is a public Magnolia instance. Here is an example subscriber from the default installation. The name of the subscriber node is magnoliaPublic8080. You can choose any name, just pick a descriptive name like corporate-website or intranet.

Node name

Value

 server

 

 activation

 

 subscribers

 

 magnoliaPublic8080

 

 subscriptions

 

 URL

http://localhost:8080/magnoliaPublic

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 connectionTimeout

10000

 readTimeout

600000

Properties:

URL

required

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

You can use either HTTP or HTTPS protocol in the subscriber URL. The syntax of URL is defined by RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax and amended by RFC 2732: Format for Literal IPv6 Addresses in URLs. The Literal IPv6 address format also supports scoped addresses. The syntax and usage of scope_ids is described in Textual representation of IPv6 scoped addresses.

The connection to a subscriber (public instance) during publishing is implemented by the java.net.URL class. In addition to IPv4, this class support IPv6 addresses. When using an IPv6 address, the address has to be enclosed in square brackets. For example [2001:0db8:85a3:0000:0000:8a2e:0370:7334].

active

optional, default is false

Enables or disables the subscriber without deleting the setup. Useful when there are multiple subscribers.

class

required, default is info.magnolia.module.activation.DefaultSubscriber

Java Bean class that holds the subscriber configuration at runtime.

connectionTimeout

optional, default is 10000 (10 seconds)

Sets a connection timeout in milliseconds. If time runs out before a connection to the subscriber can be established, a java.net.SocketTimeoutException is thrown. A timeout of 0 is interpreted as an infinite timeout.

readTimeout

optional, default is 600000 (10 minutes)

Sets the read timeout in milliseconds. If time runs before the published content is read from the author instance, a java.net.SocketTimeoutException is thrown. A timeout of 0 is interpreted as an infinite timeout.

Subscriptions

The content to be published is configured in a subscription. By default, there is a subscription for each Magnolia workspace. The subscription node name is up to you. The default naming convention uses the name of the workspace, for example websiteSubscription.

Node name

Value

 server

 

 activation

 

 subscribers

 

 magnoliaPublic8080

 

 subscriptions

 

 exampleSubSiteSubscription

 

 websiteSubscription

 

 fromURI

/

 repository

website

 toURI

/

 websiteSubscription

 

Properties:

repository

required

Name of the workspace.

fromURI

required

Workspace path on the author instance from which content is published. Use root / (forward slash) to subscribe to everything in the workspace. To subscribe to a single site, enter the site node such as /my-site. To subscribe to a particular branch, enter a more precise path such as /my-site/about.

toURI

required

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

enabled

optional, default is true

Enables and disables the subscription.

Subscribers can subscribe to 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.

Trailing slash

A trailing slash in the fromURI path limits the published content to the subnodes.

fromURI

Activated content

/

Everything

/my-site

/my-site node and everything under it.

/my-site/

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

/my-site/about

about node and everything under it.

/my-site/about/

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

Configuring multiple subscribers

A single author instance can publish content to multiple subscribers. Subscribers are key to building high-availability, load-balanced environments since they can be configured to receive targeted content. See Creating a new public instance.

Typically each subscriber resides on a separate server. In the example below, productionOne and productionTwo are subscribers. Each has a unique domain name (siteone, sitetwo) so they likely receive different content.

Node name

Value

 server

 

 activation

 

 subscribers

 

 magnoliaPublic8080

 

 subscriptions

 

 URL

http://localhost:8080/magnoliaPublic

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 productionOne

 

 subscriptions

 

 URL

http://www.siteone.com:8080/productionOne

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 productionTwo

 

 subscriptions

 

 URL

http://www.sitetwo.com:8080/productionTwo

 active

false

 class

info.magnolia.module.activation.DefaultSubscriber

Once you have your production environment established, it is recommended that you delete the default /magnoliaPublic8080 subscriber. This avoids unnecessary errors in log files that may obfuscate errors from actual subscribers.

Use cases

Site specific subscribers

Magnolia's multisite feature allows you to manage many sites on one author instance. You can configure a separate subscriber for each site. When content from one site is published it goes only to the subscriber configured for that site.

In the example below, a public corporate website, an extranet site and an intranet site are all managed on the same author instance. Subscribers public, extranet and intranet subscribe to the corresponding sites. For example, the intranet subscriber subscribes to content in the /intranet site. Content on that site is published to the magnoliaIntranet public instance.

This kind of configuration simplifies the security setup. You don't need to segregate anonymous visitors from authenticated intranet visitors since no intranet content is ever published to the magnoliaPublic instance. Intranet content is published only to magnoliaIntranet which is a completely different instance.

Node name

Value

 server

 

 activation

 

 subscribers

 

 public

 

 subscriptions

 

 websiteSubscription

 

 fromURI

/public

 repository

website

 toURI

/public

 URL

http://localhost:8080/magnoliaPublic

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 extranet

 

 subscriptions

 

 websiteSubscription

 

 fromURI

/extranet

 repository

website

 toURI

/extranet

 URL

http://localhost:8080/magnoliaExtranet

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 intranet

 

 subscriptions

 

 websiteSubscription

 

 fromURI

/intranet

 repository

website

 toURI

/intranet

 URL

http://localhost:8080/magnoliaIntranet

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

Flat authoring

Subscriber configuration can turn a hierarchical site structure to a flat one or vice versa. Editors may prefer a flat hierarchy on the author instance. For example, a busy site section such as news is edited several times a day. If that section resides deep in the site hierarchy it takes editors too much time to navigate the tree. Make an editor's life easier by moving the news section to the root level on the author instance. Adding news is now quicker. The subscription publishes the news pages to their intended deeper location on the public instance.

Node name

Value

 server

 

 activation

 

 subscribers

 

 example

 

 subscriptions

 

 news

 

 repository

website

 fromURI

/news

 toURI

/usa/politics/2015

Flat public site

An opposite example is a flat public site. Search engines prefer a shallow site structure. As a rule of thumb, the flatter the public structure the better. The higher a page appears in the site structure the more likely it will be ranked high by a crawler.

In this example, news pages are published from a deep authoring location /usa/politics/2015 to a more SEO favorable /news.

Node name

Value

 server

 

 activation

 

 subscribers

 

 example

 

 subscriptions

 

 news

 

 repository

website

 fromURI

/usa/politics/2015

 toURI

/news

Publishing multiple sites to the same public instance

The demo websites /travel and /sportstation that ship with the Magnolia bundle are an example of publishing two different sites to the same public instance. Subscriber magnoliaPublic8080 subscribes to the root node / in the website workspace so it receives content from both sites.

Node name

Value

 server

 

 activation

 

 subscribers

 

 magnoliaPublic8080

 

 subscriptions

 

 websiteSubscription

 

 repository

website

 fromURI

/

 toURI

/

Publishing the same content to multiple public instances

You can publish the same content to many sites. A corporation with regional affiliates may want to keep branding under tight control. Company logos, slogans and boilerplate text must be displayed on affiliate sites in exactly the same way.

Suppose that the corporation stores branding material such as logos in the dam workspace in a /branding folder. In this subscription example the brand material is published to Asia and Europe affiliate sites. While the content is the same, you can publish it to different location on the target sites depending on how those sites are organized.

Node name

Value

 server

 

 activation

 

 subscribers

 

 asia

 

 subscriptions

 

 branding

 

 repository

dam

 fromURI

/branding

 toURI

/corporate/branding

 URL

http://acme-asia.com:8080/magnoliaPublic

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

 europe

 

 subscriptions

 

 branding

 

 repository

dam

 fromURI

/branding

 toURI

/global-assets/branding

 URL

http://acme-europe.com:8080/magnoliaPublic

 active

true

 class

info.magnolia.module.activation.DefaultSubscriber

Publishing content from multiple author instances

Publishing content from multiple author instances to the same public instance can be useful when:

  • You serve multiple websites from the same server. The server may be specifically designed to serve particular type of content (files, video).
  • Different editorial teams contribute content to the same site. For example, a finance news team in Asia writes about Asian markets on their own author instance. However, they publish the content to a U.S. based public site.

Multiple author instances do not know about each other. This can lead to conflicts. When one user working on author1 publishes a page, another user on author2 does not know that this happened. He does not see the page on author2, only on the public instance. Even pages that exist on both author instances may be edited unnoticed. The Soft Locking module helps you handle concurrent editing but it only works within one author instance.

Publishing heavy binary content to a dedicated instance

You can publish large binary content such as video to a dedicated public instance that acts as a media server. Compared to other public instances, the media server may have more disk space or it may be configured specifically for video streaming. Other public instances serve HTML on their own but link to videos on the media instance.

3 Comments

  1. We are using Magnolia EE Pro. Activation works fine except for the added workspace news (defined in the module descriptor). In the author instance a subscriptions node has been added for the news repository. 

    /server/activation/subscribers/gruenliberalePublic/subscriptions/news

    [node] news

      [property] fromURI: /

      [property] repository: news

      [property] toURI: /


    When activating, the log says activation was successful, but when login into the public instance, the news workspace is empty. 

    Log:

    2017-08-25 13:42:49,514 INFO  nolia.module.exchangetransactional.XAReceiveFilter: 156:1503661369421 User ff_admin successfully activated /xxx on magnoliaPublic.

    2017-08-25 13:42:49,569 INFO  info.magnolia.module.activation.BaseSyndicatorImpl: Exchange: activation succeeded [/xxx]

    Restarting does not help.

    Any help would be appreciated.

    1. Hello Yann-

      Please allow me to move this to support so that we can serve you better. I will open a ticket on your behalf.

      Cheers

      1. Hi Richard, 

        oooooohhhh, my error. ACLs were not correctly set! My bad!!! Sorry!