Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate HTTP server #250

Merged

Conversation

OrMemphis
Copy link
Contributor

No description provided.

@OrMemphis OrMemphis force-pushed the memphis-nats-integrartion-http branch from 2d95dee to 171e499 Compare August 3, 2022 12:17
@OrMemphis OrMemphis changed the title Uncomment memphis-http server and Add/Remove user funcs Integrate HTTP server Aug 4, 2022
@OrMemphis OrMemphis force-pushed the memphis-nats-integrartion-http branch from 45a6fa1 to 51b356f Compare August 8, 2022 07:48
github.com/googollee/go-socket.io v1.6.2
github.com/hanzoai/gochimp3 v0.0.0-20210305004051-da66ea724147
github.com/klauspost/compress v1.14.4
github.com/lightstep/otel-launcher-go v1.5.1
github.com/minio/highwayhash v1.0.2
github.com/nats-io/jwt/v2 v2.3.0
github.com/nats-io/nats.go v1.15.0
github.com/nats-io/nats.go v1.16.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need the nats SDK package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, NATS' tests use it, and they also rely on latest version

go.sum Show resolved Hide resolved
@@ -187,7 +196,7 @@ func CreateDefaultStation(stationName string, username string) (models.Station,
Functions: []models.Function{},
}

err = broker.CreateStream(newStation)
err = s.CreateStation(newStation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to create stream

ActualPods: 0,
})
}
// if broker.IsConnectionAlive() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove these lines, in line 126 change the "control-plane" to "broker"


func (pmh PoisonMessagesHandler) HandleNewMessage(msg *nats.Msg) {
func (pmh PoisonMessagesHandler) HandleNewMessage(subject string, msg []byte) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first param is not used you can switch to _ instead

@@ -100,6 +101,10 @@ func handleError(s *server.Server, message string, err error) {

func runMemphis(s *server.Server) {

if !s.MemphisInitialized() {
s.Fatalf("Jetstream not enabled on global account")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what this error means

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that we started NATS w/o enabling Jetstream,
mostly internal as we should always use NATS+JS,
a good point, we should make the default behaviour to run with the --js flag

return nil
}

func CreateProducer() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this function and the use of it across the entire application

return nil
}

func RemoveProducer() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this function and the use of it across the entire application

return nil
}

func (s *Server) CreateStation(station models.Station) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to create stream

@@ -0,0 +1,112 @@
// Copyright 2019-2022 The NATS Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace those headers to Memphis headers across the entire application. You can find the Memphis headers inside 1 of the memphis files from the staging branch

@idanasulin2706 idanasulin2706 merged commit 2ad75d9 into memphis-nats-integration Aug 9, 2022
@idanasulin2706 idanasulin2706 deleted the memphis-nats-integrartion-http branch August 20, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants