https://discord.cloudflare.com logo
Join Discord
Powered by
# pubsub-beta
  • m

    meyer

    05/15/2023, 11:59 AM
    thank yoooou
  • z

    zim

    05/15/2023, 3:28 PM
    64e403cf1f4724e7a626a45ab6afab39
  • s

    scruffy

    05/15/2023, 5:21 PM
    Just saw the new batch, any chance I can join in?
  • e

    elithrar

    05/15/2023, 7:58 PM
    Done
  • j

    justinc

    05/16/2023, 1:44 AM
    I'm very interested in PubSub to replace my use of Ably. However, I noticed there is a limit of 1000 subscribers per topic. Are there any plans to update that to something really big? I need to send a notification to every user currently on a webpage and 1000 subscribers is too low for that. For my use case, each website is a topic (e.g. all users on cloudflare.com)
  • u

    Unsmart | Tech debt

    05/16/2023, 1:51 AM
    I personally wouldnt recommend using pubsub on a large scale production site until it is GA. And I'm not sure the limits are changing soon it seems that pubsub has kind of been on the back burner and other products are taking priority to be worked on (but I could be mistaken here just seemingly hasnt been many updates)
  • j

    justinc

    05/16/2023, 1:53 AM
    I'd definitely wait until GA before switching over. I think I must have missed the existence of pubsub, as I just realized it existed.
  • m

    Moritz S

    05/16/2023, 7:51 AM
    what would be a good alternative pub/sub provider we could use until cf pub/sub is in GA? We are looking for a "compatible" solution that would be easy to switch to cloudflare once its stable.
  • s

    scruffy

    05/16/2023, 1:38 PM
    Thanks very much for adding me to the beta. Am following the docs at https://developers.cloudflare.com/pub-sub/get-started/guide, but unfortunately I'm getting "Authentication Error 10000" when trying to create a namespace (via
    wrangler pubsub namespace create foo
    with wrangler v2.20.0). This is after creating a new API key with "Pub/Sub:Edit" and exporting it via
    export CLOUDFLARE_API_TOKEN="mynewtokenpastedhere"
    . Is there anything internal that could be causing this issue or can you think of any potential gotchas/footguns I might have run into?
  • c

    cehrig

    05/16/2023, 4:17 PM
    Hmm, that should work. The Pub/Sub token permissions I am using:

    https://cdn.discordapp.com/attachments/967783711955365899/1108065665690112010/2023-05-16_18-15.png▾

  • s

    scruffy

    05/16/2023, 4:19 PM
    Yeah, I just checked to make sure:

    https://cdn.discordapp.com/attachments/967783711955365899/1108066273641893978/image.png▾

  • s

    scruffy

    05/16/2023, 4:21 PM
    Sudden thought: might there be anything I'm missing in terms of conflicts with old tokens in Wrangler?
  • c

    cehrig

    05/16/2023, 4:23 PM
    Not a wrangler export. I just checked and the following options work for me: 1) Set
    CLOUDFLARE_API_TOKEN
    or 2) Set
    CLOUDFLARE_EMAIL
    +
    CLOUDFLARE_API_KEY
  • c

    cehrig

    05/16/2023, 4:23 PM
    *expert
  • j

    justinc

    05/16/2023, 4:34 PM
    Looks like pubsub is MQTT compatible, so you could use anything also MQTT compatible and just use MQTT libraries. But switching from one pubsub library to another probably won't be too bad - just switching out some boilerplate for publishing and subscribing.
  • s

    scruffy

    05/16/2023, 4:52 PM
    Turns out I had some environment issues but have now managed to get things sorted. Thanks for your help 🙂
  • c

    cehrig

    05/16/2023, 4:57 PM
    Good stuff
  • f

    forsalebypwner

    05/17/2023, 4:23 PM
    ddffbe0a270fdb9058888d8129d7cb48
  • s

    scruffy

    05/19/2023, 9:26 AM
    Is there (or is there likely to be in the future) an approved way to generate client tokens on demand via a worker rather than using wrangler?
  • z

    zegevlier

    05/19/2023, 10:04 AM
    You can already do this right now via the API
  • s

    scruffy

    05/19/2023, 11:56 AM
    I did try looking into the Cloudflare REST API docs but couldn't find anything... Do you have a link to more info?
  • s

    scruffy

    05/19/2023, 12:03 PM
    Or do you mean making a GET request to an
    /issue
    endpoint in the same way you might revoke credentials via
    /revoke
    ?
  • z

    zegevlier

    05/19/2023, 2:43 PM
    The API requests used to be in the docs iirc. I can't seem to find them right now though 😅
  • s

    scruffy

    05/19/2023, 4:37 PM
    Thanks for the top tip! By diving through the git history on the docs I created a successful curl request with...
    Copy code
    bash
    curl -s -H "X-Auth-Email: $CF_API_EMAIL" -H "X-Auth-Key: $CF_API_KEY" -H "Content-Type: application/json" "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/pubsub/namespaces/YOUR_NAMESPACE_NAME/brokers/YOUR_BROKER_NAME/credentials?number=2&type=TOKEN&topicAcl=#"
    Strangely, it only seems to work with the legacy global API key and email combo; using a correctly scoped API token (replacing the email and key headers with
    -H "Authorization: Bearer $CF_API_TOKEN"
    ) gives me
    {"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
  • m

    m1steranderson

    05/22/2023, 12:49 AM
    3047c08c562cc038bb307cca95ca2921 Thanks in advance!
  • h

    Heytung

    05/22/2023, 4:44 AM
    96f8637892042b2b1c3cd1569ba7f2d9 Thanks! Really looking forward to trying it out.
  • b

    beer

    05/25/2023, 3:11 PM
    🙏 980f4c932a76c709b431713c566959cf
  • t

    TheDevMinerTV

    05/25/2023, 3:37 PM
    e98dca55a016b4a79f8bb19f1c22c2a4
  • l

    lgraz

    05/25/2023, 6:30 PM
    🙏
  • Request to enable PubSub
    u

    Unsmart | Tech debt

    06/15/2023, 6:37 PM
    Will create the thread to reduce the amount of messages in the main channel 🙂
    f
    s
    +43
    • 46
    • 98