asseco-voice / laravel-stomp

STOMP native queue driver for Laravel
MIT License
4 stars 4 forks source link

Error in stomp server #26

Closed Doclassif closed 2 years ago

Doclassif commented 2 years ago

The server thinks it's one command, in the first case, an attempt to send a laravel queue, the second case is pure stomp-php. image image

Norgul commented 2 years ago

@Doclassif can you give some more info? What are you actually executing, and where is the strange behavior happening?

Doclassif commented 2 years ago

@Norgul

@Doclassif can you give some more info? What are you actually executing, and where is the strange behavior happening?

I use the docker image efrecon/stomp In laravel I execute TestJob::dispatch(), which just writes to the log file, and the stomp server in docker gives the following message.

Maybe I'm just using the wrong stomp server? =)

Norgul commented 2 years ago

@Doclassif can you show me how did you define .env variables?

Doclassif commented 2 years ago

@Doclassif can you show me how did you define .env variables?

APP_NAME=stomp APP_ENV=local APP_KEY=base64:DRNK3599q8NrOd0vng5bgzHbppI1t734OMCzmABrKjQ= APP_DEBUG=true APP_URL=http://localhost

LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=

BROADCAST_DRIVER=log CACHE_DRIVER=file FILESYSTEM_DISK=local SESSION_DRIVER=file SESSION_LIFETIME=120

QUEUE_CONNECTION=stomp

STOMP_PROTOCOL=tcp STOMP_HOST=stomp STOMP_PORT=61613 STOMP_USERNAME=admin STOMP_PASSWORD=admin STOMP_READ_QUEUES=queue_read STOMP_WRITE_QUEUES=queue_write

STOMP_LOGS=true

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_HOST= PUSHER_PORT=443 PUSHER_SCHEME=https PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" VITE_PUSHER_HOST="${PUSHER_HOST}" VITE_PUSHER_PORT="${PUSHER_PORT}" VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

And dockercompose

version: "3.8" services: app: build: context: . dockerfile: ./Dockerfile #php image 8.1 image: stomp-backend container_name: stomp-backend restart: unless-stopped environment: XDEBUG_CONFIG: remote_host=host.docker.internal remote_port=9003 remote_enable=1 volumes:

networks: stomp-network: driver: bridge

Norgul commented 2 years ago

Well, it looks configured okay. Strange though, the error message you gave looks as if the server is handling Laravel serialized class as a full message instead of payload only. I will be publishing update soon, but I don't believe it will tackle this one. Need to check with that specific STOMP server. If you get any insights about it before me though, please do say.

Also, could be because some of the headers there are hardcoded to support ArtemisMQ (which we use), didn't have time to abstract that part

Doclassif commented 2 years ago

Advise which stomp server to use on linux?

Norgul commented 2 years ago

Didn't use anything aside ArtemisMQ for STOMP, but our servers are on Linux as well.

Doclassif commented 2 years ago

Ok, I figured out artemis, now I have a question, why does it create 5 sessions, is this normal? artemis Screenshot_7 client id is the same

Norgul commented 2 years ago

It is normal if you have 5 workers. You can make all workers connect on a single queue by specifying it in topic::queue format for READ_QUEUES.

Doclassif commented 2 years ago

@Norgul Thank you for your help