Dev Notes The RSS feed for Dev Notes.

Notes about software development.

  • Had to do some changes to NATS streams and consumers today, and learnt a few things from doing so.

    First, it is possible to change the subject filters of a NATS consumer while it’s being used. That is, a client could be using it to pull messages, and it doesn’t need to reconnect or anything to get the effect of the consumer change. It will continue to receive messages, so long as they match the new subject filter.

    Second, if you’re using the NATS CLI to change the filter, in order to specify multiple subject filters, include multiple --filter switches:

    $ dc-nats consumer edit \
            --filter='topic.one' \
            --filter='topic.two' \
            --filter='topic.reset.>' my-stream my-consumer
    

    Specifying a single --filter value with subjects separated by commas will not work. I’m not entirely sure what will happen but I suspect that it will create a subject filter that includes the commas in some way.

  • I’m not sure if I’m the only one that experiences this but SSH on MacOS seems to have awful keep-alive out of the box. Connections constantly hang when I look away for more than a few minutes. So I can recommend this change in your SSH config:

    # /etc/ssh/ssh_config
    Host *
        ServerAliveInterval 30
    
  • The Stripe CLI doesn’t have a command for listing account tax IDs, but it’s still possible to list them using the get subcommand. For anyone else that needs it, here’s how you can list them:

    stripe get /v1/tax_ids
    

    And to get a single tax ID:

    stripe get /v1/tax_ids/txi_abc123
    
  • TIAL that sleep is actually not available on the Distroless Docker images, at least from what I can see from Stack Overflow. So if you’re going to use Pod Lifecycle events to wait for requests to finish up, you’ll need some other means of sleeping.