Skip to content

Instantly share code, notes, and snippets.

@asim
Created September 5, 2016 13:38
Show Gist options
  • Save asim/f454eea9ba1f620ee9c0ea49ccd6ea45 to your computer and use it in GitHub Desktop.
Save asim/f454eea9ba1f620ee9c0ea49ccd6ea45 to your computer and use it in GitHub Desktop.
package main
import (
"time"
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/client"
example "github.com/micro/micro/examples/template/srv/proto/example"
"golang.org/x/net/context"
)
func main() {
cmd.Init()
p := client.NewPublication("topic.go.micro.srv.template", &example.Message{Say: "hello"})
client.Publish(context.TODO(), p)
time.Sleep(time.Second)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment