Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

server 2 server questions publishItem nodes, listening and push

Avatar

Level 4

hey,

I'm trying to publish to the history node of a chat pod i call "chatPod".
I'm guessing that if I publish there I can see any text comming from the server.

when running publishItems. the node i think im publishing to (history) shows up as its own node under CollectionNodes

with no nodes of its own.

here is the CF code. at some point i need to communicate this to some ruby devs

        <cfset items = StructNew() />

        <cfset items.publisherID = "">
        <cfset items.body.color = 0>
        <cfset items.body.displayName = "User">
        <cfset items.body.msg = "This is a test from CF server">
        <cfset items.body.recipientDispalyName = "">
        <cfset items.body.role = 10>
       
        <cfset result = Session.accountManager.publishItem("devroom", "chatPod", "history",items, true)>

im also trying to listen to events in the room are they system events like:

CollectionNodeEvent.ITEM_RECEIVE

when this happens do I just have a CFC with a function called "receiveItem" with the right amount of parameters?

If I can listen for an event then publish a new item to a node. then i can have all interested clients listen to that event and do something.

does that make sence?

thanks.

...russ

14 Replies

Avatar

Former Community Member

Hi Russ,

Please refer to the CF readme file (part of SDK) for instruction to setup the listener to catch events of the publishItem (see attached).  - RTCHOOKS.cfc is the handler for call back events you might want to look at. 

As for how you publish the item, you are on the right track.

if you created your collectionNode ("ChatPod") and your node ("history"), then your call to publishItem is correct. (you don't need to set publisherID to empty string)

best,

Dean

Avatar

Level 4

Thanks for the info.

I think part of my current problem is that I don't see any call backs at all. So I cant tell if this is working or not.

Even looking at my server logs I'm not sure.

The files that come with the SDK tell me that my hook is fine and im subscribed to the correct collection.

But when publishing to any node in that collection doesn't give me any server side data.

I'm sure there is something simple missing.

thanks

...russ

Avatar

Former Community Member

Hi Russ,

1)  Please make sure that your callback url is proper working, you can use "curl" on command line to see if the post data works and getting back status 200. (also use gethookinfo call to see if it is registered in the server)

2) make sure your remoting-config.xml "LCCS.RTCHOOKS" match the directory under your webroot, i.e. LCCS isthe directory name, RTCHOOKS.cfc is the file name

3)  invoke register hook with hook url (e.g. "http://<coldfusionserver>/flex2gateway/").  If you want to change this url you need to update the channels within services-config.xml and remoting-config.xml files. (currently this LCCS hook use default remoting channel of "my-cfamf")

4)  log in to the coldfusion administrative panel and see your logging properties.You might need to update some logging parameters based on your default settings. You should see the logs in LCCS.log file under logs folder.

5) A simple verification of getting the call back is trying to subscribe to the UserManager collection.  as you log in and out of the LCCS, you should get your hook invoked.

6) You can also try out the coldfusion example under the sampleApps/Server2Server/S2SGateway_ColdFusion/

Let me know if it helps.

Dean

Avatar

Level 4

Thanks im digging though it now

on the CF side im on a hosted account so all the CF admin stuff i dont have access to

Im using the -services attribute when compiling the flex code pointing to the same remoting-config.xml thats in the example files

My CFC is inside the LCCS folder. I am trying to write to a text fille since i dont have access to logs.

I'm also working on a ruby project with the same issues (im testing ideas with CF then explaining to the ruby guys how it should work)
So from what we see, call backs aren't happening either. Similar deal hooks and subscriptions look good but no http calls

In both instances we are using the files from the SDK and it looks okay.

thanks for your help.

I'm looking into curl now to see if that helps.

...russ

Avatar

Former Community Member

Hi Russ,

Maybe it is a good idea, getting a copy of local CF server and Rail server and get them to work first.   Server2Server for Coldfusion is assuming you have the flash remoting configured correctly. 

You can also post your hook url, so I can double check on our side if we are calling you.

Dean

Avatar

Level 4

Hi,

Thanks for you help.

I was using remoting to my server as an all AS project so i was guessing that the URL should be the same since its working for that.

I'll reinstall CF and get a remoting instance working locally.

as for the public URLS

ruby:

http://collegeonly-honey.heroku.com/amf/

CF:

http://spaceappleyoshi.com/flashservices/gateway/

http://spaceappleyoshi.com/flex2gateway/  - doesn't seem to work. but it could be me

thanks

...russ

Avatar

Former Community Member

Hi Russ,

Did the local build working for you?  I only see the "http://collegeonly-honey.heroku.com/amf/" ruby endpoint, not seeing the coldfusion endpoint, but then I could be missing the log entry.  Can you use getHookInfo api to query the LCCS server for the hook url? and see if it is returned the same as your input.

thanks

Dean

Avatar

Level 4

hi,

sorry for the delay.

We looked at the ruby endpoint and just dont see any traffic going there.

I guess we need to take another look at it.

As far as my CF end point. I have remoting working fine on the local machine. updated the remote-config.xml file with the new destination info.

made sure there is a LCCS folder with the CFC on my webroot.

the sample files till me that everything is succssful. i've tried to have it write text files or send me emails just to know that it works. but so far nothing.

Im sure the problem is between the chair and the computer

here is my url to the CF endpont http://spaceappleyoshi.com/flex2gateway/

you should be able to see my login file inside the LCCS directory.

thanks again for your help.

...russ

Avatar

Former Community Member

Hi Russ,

Do you have your LCCS account url and account info?  you can send to me at dchen@adobe.com

thanks

Dean

Avatar

Former Community Member

just want to state the obvious, I am sure you updated the Account URL to reflect your LCCS account through out the example,correct?

Dean

Avatar

Level 4

yea.

i've pointed to my account and the test files tell me that everything is good.

thanks.

...russ

Avatar

Former Community Member

Hi Russ,

I have verified that we http post to your endpoint "http://spaceappleyoshi.com/flex2gateway/" on our server.  Please verify on your end that you are getting the call.  either wire-shark or charles capturing the http traffic.

thanks

Dean

Avatar

Former Community Member

Hi Russ,

Glad that you are receiving the callbacks, maybe getting the CF to work first than ruby.  So hopefully your gateway is setup correctly and you have permission to write to logs.

best,

Dean

Avatar

Level 4

hi,

I have my session on my CF server. And a LCCS folder on the root with the RTCHOOKS.CFC sitting inside.

It looks like LCCS is posting back to my server. But I just don’t have any idea if its doing anything

Any idea of what I should be looking for.

What are the params that LCCS sends back?

Thanks

…russ