Using Topic Views 5: Naming Reference Topic With Topic Content

Martin Cowie - July 9, 2019

Using topic content to name a reference topic

Let’s quickly introduce a new topic tree before we go any further, which lends itself well to this use case. The Demo/Fx topic tree is driven by this script: https://github.com/pushtechnology/topic-views-example. It pulls real market data from truefx.com to populate a tree of foreign exchange prices.

  • Subscribe to the new topics.
  • Open the Subscriptions tab to observe their structure and the changing values.

Notice that the topics are named Demos/Fx/raw/0, 1, 2, etc., and that each topic contains the field  pairName that holds a string giving a more understandable name for the particular currency trade, such as “EUR:USD”. In this example, we will use a topic view to create intuitively named reference topics using the pairName values.

Discussion: It is not always possible to adjust the topic publishing habits of another Diffusion client: it may belong to a third party with different priorities. Using a topic view can quickly and pragmatically solve this problem.

  • Open the Topic Views tab.
  • Click Add and create a new topic view named Demos/Fx currency pairs
  • Give it the specification:map ?Demos/Fx/raw/.* to Demos/Fx/<scalar(/pairName)>

  • Click Add and open the Topics tab.
  • Browse to the topic branch Demos/Fx to see the more intuitively named reference topics created by the topic view.

Summary

Using the source value directive scalar() we have built reference topics with more intelligible names, using values from within the source topic.

Next: Changing topic properties of reference topics.


The Diffusion Real-Time API Management Platform manages, optimizes, and integrates data among devices, systems, and applications. Push Technology pioneered and is the sole provider of real-time delta data streaming™ technology that powers mission-critical business applications worldwide. Leading brands use Push Technology to fuel revenue growth, customer engagement, and business operations. The products, Diffusion® and Diffusion Cloud™, are available on-premise, in-the-cloud, or in a hybrid configuration, to fit the specific business and infrastructure requirements of the applications operating in today’s mobile obsessed, everything connected world. Learn how Push Technology can reduce infrastructure costs, and increase speed, efficiency, and reliability, of your web, mobile, and IoT application.

Learn More: View Blog Posts and Developer Resources

Share:

Check out these other resources

Info

Info Center

Case Studies, White Papers, and Tech Talk notes relating to Diffusion and the customers benefiting from using it.

Info

Quick Start Guide

Step-by-step guide to getting started fast with Diffusion or Diffusion Cloud.

Info

Diffusion Cloud

Get the facts and the details about our Diffusion Cloud platform.