Pub/Sub Web App User's Manual

Register a new account

Creating a new user account for Cogswell is a simple process. Navigate to https://cogswell.io/#!/register and enter your user information in the required fields.*

  • First Name - Minimum of 1 character
  • Last Name - Minimum of 1 character
  • Company Name - Minimum of 2 characters
  • Job Title - Minimum of 2 characters
  • Email - Must be a validate email address
  • Password - Minimum of 8 characters
  • Confirm Password - Minimum of 8 characters and must match the Password field

* Note: All fields in Cogswell are case-sensitive

Once all user information is entered, and you have answered the Captcha question, click the 'Sign Up' button. An email is sent to the email address entered asking you to confirm your registration: "A confirmation message has been sent to your email address. Please confirm your registration, then login here." Once you receive the e-mail and click the link in the e-mail to confirm your registration, your account is activated and you is returned to the Cogswell login page.

Logging In and Changing to Pub/Sub

Logging In

Fill in the 'Username' and 'Password' fields on this page. The 'Username' is the email address that was entered when creating an account. Enter the Password that was created when creating an account. Then click the 'Login' button.

Changing to the Pub/Sub View

When you first log in, you will need to change the view from the Complex Event Processing view to the Pub/Sub view. Follow the steps below to make this change.

  1. Click the 3-Bar icon at the top-left corner of the screen.
  2. This displays a drop-down menu with “Complex Event Processing” and “Pub/Sub”
  3. Click on Pub/Sub to change from the Complex Event Processing view to the Pub/Sub view.

  4. You are now in the Pub/Sub view.

Getting Around in Cogswell Pub/Sub

Getting around in Cogswell Pub/Sub is fairly simple. Here are some helpful hints.

  • Cogswell Views
    • There are two views in Cogswell: Complex Event Processing and Pub/Sub.
    • When your first log in, you are in the Complex Event Processing view.
    • The current view can be changed by clicking the 3-Bar icon at the top-left of the screen and clicking on the desired view.
  • Navigation Bar
    • The navigation bar is the green panel on the left side of the screen.
    • You can change the size and display of the navigation bar by clicking 4-Bar icon.
    • In the Pub/Sub view, the navigation bar has 3 links.
      • Projects: You can view a list of your Pub/Sub projects.
      • Add Project: You can create a new Pub/Sub project.
      • Welcome: You can view documentation for Pub/Sub.
  • Lists
    • You can control how many rows of a list to show, 10, 25, 50 or 100.
    • 'Name' fields are sorted alphabetically and can be sorted A-Z or Z-A.
    • 'Date' fields are sorted chronologically and can be sorted newest to oldest or oldest to newest.
    • All lists can be searched by key words.
  • Account
    • Click your user name at the top-left of the screen, then click on Account.
    • You can view your usage and change your account settings.

Projects

Creating Projects

There are two ways to create a Cogswell Pub/Sub project: (1) Create a new Pub/Sub project, or (2) convert an existing Complex Event Processing project into a Pub/Sub project.

Create a New Pub/Sub Project

  1. Click on “Add Project” in the Navigation Bar.
  2. The “Add Project” dialog will be shown.
    1. You can cancel creation by clicking the X in the upper-right of the dialog.
  3. Enter a name for the project in text box under “Create New Project.”
  4. Click “Create.”
  5. Your new Pub/Sub project is created.

Convert Existing Complex Event Processing Project

  1. Click on “Add Project” in the Navigation Bar.
  2. The “Add Project” dialog will be shown.
    1. You can cancel conversion by clicking the X in the upper-right of the dialog.
  3. Click the name of the project you wish to convert under “Convert Existing CEP Project.”
  4. If the project you wish to convert is not shown:
    1. Use the “Previous” and “Next” buttons in the lower-left to search for the project. (OR)
    2. Search for the project by name using the Search text box at the upper-right.
  5. The background of the project you choose will turn green.
  6. Click “Convert.”
  7. Your CEP Project is now converted into a Pub/Sub Project.*

* Note: CEP Projects converted into Pub/Sub projects are still CEP projects after the conversion.

Viewing Projects

Projects List

To view your Pub/Sub projects, click on “Projects” in the navigation bar. This takes you to the “My Projects” page. The “My Projects” page lists all of your Pub/Sub projects* and provides transmission details for each project. Finally, you can manage the project keys for a specific project by clicking on the project name, or by clicking on “Manage Keys” for that specific project.

* Note: If you have more Pub/Sub than can be displayed, click “Previous” or “Next” at the lower-left of the page to view your other Pub/Sub projects. You can also search for specific Pub/Sub projects by keywords using the text box at the upper-right of the page.

Project Details

The details for Pub/Sub projects as seen on the “My Projects” are explained.

  • “Name:” The name of the Pub/Sub project.
  • “Date Added:” The date the project was created or converted.
  • “This Hour:” The number of messages published and transmitted for the last hour.
  • “Today”: The number of messages published and transmitted for the day.
  • “Last 7 Days”: The number of messages published and transmitted for the last 7 days.
  • “Last 30 Days”: The number of messages published and transmitted for the last 30 days.

The number of messages published is figured by counting the publish requests for that project. The number of messages transmitted is figured by counting each message sent to each subscriber as one message. As an example, if you publish 3 messages, and 7 subscribers are listening for that message, then the number of messages published is 3, but the number of messages transmitted is 7 * 3 = 21.

Project Keys

Description

Each Pub/Sub project has a list of project keys associated with that project, and each project key is further divided into three permission keys: admin, read, and write. In addition, each project key for a specific project can be either enabled or disabled.

  • The read key gives permission to subscribe to any channel on the associated project.
  • The write key gives permission to publish to any channel on the associated project.
  • The admin key gives permission to do any administrative work on the associated project.

If a project key is enabled, then all requests made with that project key and the associated permission keys behave as defined previously.

If a project key is disabled, then all requests made with that project key or the associated permission keys are denied.

Create Project Key

Every Pub/Sub project begins with a default project key. However, depending on your use case, you may need additional project keys. The following explains the steps in creating addition project keys.

  1. Click on “Manage Keys” on the “My Projects” page for the project for which you are creating a new project key.
  2. Click on “New Key.”
  3. Type in a name for the new project key in the “Key Alias” text box that appears.
  4. Click on “Create Keys.”
  5. The “Edit Key” dialog appears.
  6. Click on “Save Changes.”
  7. The new project key is created.

Edit Project Key

After creating a project you key, you can change the name of the project key and enable or disable the project key. In order to change either, do the following.

  1. Click on “Manage Keys” on the “My Projects” page for the project for which you are editing a project key.
  2. Click on the name of the project key that you wish to edit.
  3. The “Edit Key” dialog appears.
    1. You can cancel your edits by clicking the X in the upper-right of the dialog.
  4. Make your edits in this dialog.
    1. If you wish to change the name of the key, edit the text in the “Alias” text box.
    2. If you wish to disable an enabled key, then click the check mark next to “Enabled.”
    3. If you wish to enable a disabled key, then click the empty box next to “Enabled.”
  5. Click "Save Changes."
  6. Your changes to the project key have been saved.

Channels

When working with a Pub/Sub project, you publish messages to channels associated with that project and your clients subscribe to those channels in order to receive those messages. Because channels are associated with their respective project, they must be unique per project and anybody with the correct permission keys associated with that project can publish or subscribe to any channels on that project.
 

Server Behavior

Sessions

Pub/Sub sessions are associated with active and recently active sockets. When a client connects, the server will attempt to restore the prior session if the client supplies a session ID. If the client does not supply a session ID, or the session has expired, the server will create a new session, and supply the new session ID to the client when requested.

Session Restore

If a client supplies a read (subscribe) key on connect, and they have requested their session UUID at least once, then their session will be persisted. A persisted session is updated on each subscribe or unsubscribe event (including unsubscribe-all). This allows the client's subscriptions to be restored on successful session resume.

A session restore is attempted by the server if the client populates the session_uuid field in the Payload header on connect. If the server is able to find a session with the same UUID associated with the same project as the newly authenticated client, then the session will be resumed, including all subscriptions which were held when the client was disconnected.

The client can determine whether their session was replaced by comparing the result of a session UUID fetch with the UUID they supplied on connect. This is built in to all official SDKs, and when the session is replaced, a session replacement event is emitted, to alert the client to the fact that their subscriptions have not been restored.

Session Expiration

When a read (subscriber) client's connection is lost (whether initiated by the client or service disruption), the client has a "grace period" of 5 minutes during which they can reconnect and resume their prior session. If they reconnect after 5 minutes have elapsed, their session will automatically expire, and their subscriptions will be lost.

After a connection loss, the official SDKs will automatically attempt to reconnect with a exponential backoff applied.

Limits

Services must apply limits in order to prevent abuse (whether intentional or accidental).

Max Message Size

The maximum size of Pub/Sub message is 64kB. Keep in mind, this is bytes, not characters. Since the encoding for JSON is UTF-8, traditional latin characters (standard ASCII) will be encoded with a single byte. Those characters which are not a subset of ASCII may consume substantially more space. Therefore a simple count on the size of a string is insufficient to determine if a messages is too large. A good practice is to keep message sizes under 10k characters, and you should never have a problem. This will keep delivery latencies lower as well.

If a message is larger than the maximum allowed size, the client connection will be terminated.