graniteamf channel for a cluster

78 views
Skip to first unread message

Lasha K

unread,
May 13, 2015, 5:20:08 AM5/13/15
to gran...@googlegroups.com
Hi, guys.
I have configured graniteds in my application and it is working fine, but when I've started my application on a cluster with a loadbalancer - my clients are not receiving messages.
I am configuring gravityamf channel like this:
channelSet.addChannel(new GravityChannel(GRAVITY_CHANNEL_NAME, "http://{server.name}:{server.port}/" + SERVER_CONTEXT + "/" + GRAVITY_CHANNEL_NAME + "/amf"));

and Spring automatically replaces URL to "http://localhost:7001/APPNAME/gravityamf/amf
but for the loadbalancer + cluster Spring cannot automatically replace it with appropriate values.

In documentation i see that channels may be defined like:
    <channels>
       
<channel-definition id="my-gravityamf" class="org.granite.gravity.channels.GravityChannel">
           
<endpoint
               
uri="http://{server.name}:{server.port}/{context.root}/gravityamf/amf"
               
class="flex.messaging.endpoints.AMFEndpoint"/>
       
</channel-definition>
   
</channels>

but what about a cluster? Should I have 2 channel definitions? Will Spring automatically replace those "server.name", "server.port", with a values from a server that is situated in a cluster?


Ergu

unread,
May 13, 2015, 6:03:45 PM5/13/15
to gran...@googlegroups.com
You should use the spring config style to configure your topics.

Spring automatically detects those in and creates them for your.

Check the ActiveMQ section of the documentation.

Sent from my iPod
--

---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Granite Data Services Forum".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Ergu

unread,
May 13, 2015, 6:07:15 PM5/13/15
to gran...@googlegroups.com
You should also use a valid url like

Or

There is no channel name based on my experience.

The channel name is the topic you set in the flex code.

Granite will detect the rest!

Sent from my iPod

On 2015-05-13, at 11:20, Lasha K <kva...@gmail.com> wrote:

Ergu

unread,
May 13, 2015, 6:10:55 PM5/13/15
to gran...@googlegroups.com
If you are using nGinx as loadbalancer you need to redirect all request to the java server and make sur to use a load balancing plugin to let the lb talk with each server to verify which server is taking the requests from a specific client ip address.

Sent from my iPod

On 2015-05-13, at 11:20, Lasha K <kva...@gmail.com> wrote:

Ergu

unread,
May 13, 2015, 6:12:02 PM5/13/15
to gran...@googlegroups.com
Check on the net for nGinx loadbalancer for Tomcat and you will find many exemples!

Sent from my iPod

On 2015-05-13, at 11:20, Lasha K <kva...@gmail.com> wrote:

Lasha K

unread,
Jun 1, 2015, 9:57:26 AM6/1/15
to gran...@googlegroups.com
Sorry for the late answer, was busy solving another graniteDS problem.

You should use the spring config style to configure your topics.
Yes, I'm using them and I've configured them and they are working good if I connect directly into the nodes (e.g localhost:7003 and localhost:7004 and the messaging works then), but when I connect throught the LB, I have the access to the APP, but JMS push doesn't work.
To be more concrete, after the PING operation that GraniteDS flex client sends to the GraniteServer - no operations are sent.
In error.log of the Apache2.2 server I'm facing:

[Mon Jun 01 16:41:43 2015] [error] [client 127.0.0.1] ap_proxy: trying POST /APP_NAME/gravityamf/amf at backend host 127.0.0.1/7003; got exception 'PROTOCOL_ERROR [line 941 of ../common/URL.cpp]: malformed transfer chunk 1'; state: reading response body from WLS; not failing over, referer: http://localhost/APP/VJET-1.7-SNAPSHOT.swf

It seems that I'm using wrong protocol, but I'm using HTTP protocol for: graniteamf and gravityamf channels.
Reply all
Reply to author
Forward
0 new messages