Solved

How to integrate BlazeDS with amfphp?

Posted on 2010-08-23
4
445 Views
Last Modified: 2012-05-10
I am trying to create a live auction with Flex Builder 4 and am looking show a database real-time.
0
Comment
Question by:jth_92
  • 3
4 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 33501375
Well I doubt this will be possible at all. BlazeDS is a Java Implementation and therefore runs in a Java Servlet Engine. AmfPHP sort of sounds like PHP and this runs in an entirely separate container.
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 33501439
What exactly are you trying to do? It seems that AmfPHP is a PHP implementation of a lib able to read/write AMF format. This functionality is also included in BlazeDS as it speaks AMF out of the box. Are you trying to add real-time-features as provided by BlazeDS and Coldfusion to a php application? If yes, I would completely drop the BlazeDS approach and try to find some AMF Streaming Lib for PHP instead.
0
 
LVL 1

Author Comment

by:jth_92
ID: 33505830
My goal is to display data real-time from the database meaning that whenever the database updates the Flex datagrid updates as well. I tried using ColdFusion at first due to easy integration with Flex 4; however, I kept receiving errors and when I did set up messaging it was slow. I have successfully configured amfphp but am not sure if ColdFusion and BlazeDS would be more efficient if I configured it correctly.
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 33505980
Well ... I think there is nothing more efficient than ColdFusion for what you are looking for. Especially when dealing with a lot of concurrent users. If you have only a few (not more than 50 or so) you are good to go with BlazeDS (ColdFusion can handle Non-Blocking-IO, BlazeDS Blocks one thread per user ... making you run out of HTTP-Threads after some logins). I doubt that AMFPHP will get you on the way ... I guess the reason that ColdFusion was slow, was a configuration error on your side.

Colf Fusion and BlazeDS allow mutliple types of communication ... Starting with Polling AMF which polls the Server every 2 or 3 seconds. The next realtimisher option is Long polling (causing the client so start a request ... the server halts the response and responds only if there is something to be sent ... after the response, a new request is sent by the client ... waiting until new news arrives (This option blocks a HttpThread of the Webserver). The Coolest (my oppinion) is the Streaming AMF type, which also blocks an entire HttpThread ... it opens a socket and allows for bi-directional events to be sent in realtime. I guess this is what you were looking for.

The main difference between BlazeDS and Coldfusion are the capability of ColdFusion being able to server allmost an indeffinite number of client while BlazeDS quits at the number of HTTP Threads configured by the Servlet Engine you are using ... but for the price of a ColdFusion you can certainly puchase a really nice new Car with a really good stereo ;-)

If you're not stuck to PHP and you don't expect a large number of clients I'd stick to BlazeDS and if you do have a lot of concurrent users you I think there is no better option than Coldfusuion.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question