question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hypen in pubsub topic name breaks delivery

See original GitHub issue

Describe the bug When using this: example.hello topic name, messages get delivered okay. When using this: example-hello topic name, messages do not get delivered.

To Reproduce

"use strict";

// does not work
const topic = 'example-hello';

// does work fine
// const topic = 'example.hello';


const opts = {
    realm: 'realm1',
}
const ws = new Wampy('/ws', opts);
ws.subscribe(topic, function (dataArr, dataObj) {
    console.log('got it', dataArr);

});


const w2 = new Wampy('/ws', opts);
w2.publish(topic, 'hello-foo');

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KSDaemoncommented, Oct 25, 2020

Hi @cameronelliott! I don’t think you noticed that in the documentation:

* **uriValidation**. Default value: strict. Can be changed to loose for less strict URI validation.

And as @gammazero already mentioned, strict validation is preffered. In this case you can safely use any router and client and be sure about interop.

1reaction
gammazerocommented, Oct 25, 2020

@cameronelliott

  • Yes, applications should use the strict spec. This guarantees them a compatible URI.
  • Client libraries may allow both, but a client library could choose to be opinionated about this and decide to restrict to only using strict. This is likely as the library implementer does not want to handle issues arising from someone’s use of a client not working with a router that is configured to only handle strict spec.
  • Routers should allow both, but that is a choice and is configurable.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and use topics | Cloud Pub/Sub Documentation
This document explains how to create, update, view, and delete a Pub/Sub topic. This document also explains how to name topics and subscriptions....
Read more >
pubsub - Go Packages
Package pubsub provides an easy way to publish and receive Google Cloud Pub/Sub messages, hiding the details of the underlying server RPCs.
Read more >
6. Compounding Rules A compound word is a union of two or ...
The hyphen is a mark of punctuation that not only unites but also separates the component words; it facilitates understanding, aids readability, and...
Read more >
Amazon Simple Notification Service (SNS) FAQs - AWS
Q: What is the format of an Amazon SNS topic? Topic names are limited to 256 characters. Alphanumeric characters plus hyphens (-) and...
Read more >
Things I wish I knew about Google Cloud Pub/Sub: Part 2
First, a publisher sends a message to the topic. Once the Pub/Sub server receives the message, it adds fields to the message such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found