Friday, November 9, 2012

ActiveMQ 5.3 vs. 5.7

I have been reviewing the latest features of ActiveMQ 5.7.  There are features in 5.7 that are not in the 5.3 version that I'm most familiar with.
Features like:
  • Message Priority
  • Web Sockets
  • Delay and Schedule Message Delivery
  • Cluster and Failover 
  • more
 I did some comparisons of ActiveMQ version 5.3 vs. 5.7 on the following local machine:
Intel Core i7 Q720 @ 1.6GHz with 8gb ram on 64 bit Windows 7 Ultimate.

Scenario 1: Producing and Consuming small 'hi' test messages of the amount of 10K on 5.7 ActiveMQ versions locally using ONE consumer with transacted messages (activemq-all-5.7.0.jar).
Scenario 2: Producing and Consuming small 'hi' test messages of the amount of 10K on 5.3 ActiveMQ versions locally using ONE consumer with transacted messages. (activemq-all-5.3.0.jar)
Scenario 3: Producing and Consuming small 'hi' test messages of the amount of 10K on 5.7 ActiveMQ versions locally using ONE consumer with NON transacted messages. (activemq-all-5.7.0.jar)Results:
Scenario 4: Producing and Consuming small 'hi' test messages of the amount of 10K on 5.3 ActiveMQ versions locally using ONE consumer with NON transacted messages. (activemq-all-5.3.0.jar)Results:

TransactedProducing 10,000 MessagesConsuming 10,000 MessagesActive MQ Version
Scenario 1 1.8 Seconds (avg)113 Seconds (avg)5.7
Scenario 2 2.8 Seconds (avg)110 Seconds (avg)5.3
Non-Transacted   
Scenario 3 2.8 Seconds (avg)12.3 Seconds (avg)5.7
Scenario 4 2.0 Seconds (avg)9.3 Seconds (avg)5.3


Conclusion: Speed isn't sufficient enough to warrant an upgrade in this case as they both are basically running at the same pace, however the most interesting part I saw here was the speed differences between Transacted messages (slower) and Non-Transacted Messages.  By a multiplier of about 10X, transacted message consumption through the ColdFusion Gateway slows down.  Its worth asking yourself "Can I handle a loss of messages?" at this speed difference.

The stability of the two of them should be similar but we will have a chance to put 5.7 to the test soon enough.  If you're seeing some strange issues in production like we are where ActiveMQ gets into a 'stalled' state where its neither producing, nor allowing consumption of messages in it's queues, you are not alone.  I've seen graphs that have shown ActiveMQ in this state and a restart is the only thing that brought it back to life (5.3).  After churning through millions of messages a day, I'd guess something might hit a breaking point, but hopefully 5.7 will give us a bit more stability over the long haul.  Better monitoring of the queue counts need to be in place for us to reliably use 5.3 now, however I like it for it's features, ease of use and integration with ColdFusion (thanks Sean Corfield for the Gateway and Documentation!).

Hung Threads using ActiveMQ and ColdFusion

I have been working with the ActiveMQ gateway for years now, and I just had to dig deeper as we encounter odd states with ActiveMQ over time in production.  After starting and stopping a cfGateway in the cfadmin 2x, I do a thread dump on the server and see that there are 4 threads that have been generated as a result.  The more times you start/stop, the more threads seem to stick around indefinitely (forever from what I see).  Is it possible there's some leak here or close not being properly called through cfadmin to Gateway?  I'm using cf9 local dev and activemq 5.7 but 5.3 also suffers from the same thing (threads pile up on start/stop).  At times I've also seen the Consumer Count not match the number of consumers that should be listed using ActiveMQ 5.3 and cf8 i.e. if there are 16 consumers, I've seen 32.  I shut the 16 off, and 16 still remain as 'registered' consumers (which may tell me that these background threads are alive, yet dead, as they typically never take any messages.

Thread Dump:



Anyone else have this problem or can confirm that this is a similar behavior to what you're seeing?

Tuesday, November 1, 2011

Deploying Cold Fusion to Google's App Engine and Big Table


At the ColdFusion User Group in Minneapolis Wednesday November 3, 2011 I will be presenting on the topic of "Deploying Cold Fusion to Google's App Engine and Big Table".


Learn the basics of app engine, the deployment methodologies required to develop a Cold Fusion application with Open Bluedragon on gae, and the nuances of working with 'big table', Googles distributed object data store.


Visit ColderFusion.com to RSVP!


Looking forward to seeing you there


Update:
Those interested in the files (pdf, some code minus the jar files) can download it here.  If you're looking for the magic bits for the working OpenBD version, see the pdf link for the enlist project link.

Monday, January 24, 2011

(Minneapolis) Application Architect / Developer Job - Jobs2Web, Inc.

Location: Minnetonka, MN, USA
Are you looking for an opportunity to maximize your career with one of Minnesota’s fastest growing internet startups? Jobs2Web is one of the few venture backed Minnesota startups which made the Inc 500 list in 2009 and 2010 for our fast growth, and now we’re looking to expand our team of passionate professionals in the human capital software marketplace.
Jobs2Web helps employers maximize their interactive recruiting strategy using our recruitment marketing platform. The Jobs2Web platform helps major employers to attract, capture, and communicate with quality talent all while measuring recruiting effectiveness using our patent-pending solutions which dramatically reduce dependency on expensive and less effective sourcing mediums.
Working within our company will put you close to our award winning technology that combines the best of recruiting and marketing solutions including Search Engine Marketing (SEO), SEM (Pay-Per-Click), Social Networks and Social Media Marketing, and Email Marketing.
The Architect / Developer enhances and maintains the Jobs2Web Recruitment Marketing Platform and associated applications.
Specifically, the Application Architect / Developer role will have impact through these responsibilities:
  • Create and maintain the application architecture for the Jobs2Web platform, provide application architecture guidance to the development group and other Jobs2Web departments, and engage in hands-on development as required.
  • Participate in a dynamic team environment, including frequent team feedback, collaboration, training and code review.
  • Professionally communicate with our internal clients, including Client Services and Sales.
  • Demonstrate ability to manage multiple priorities in a fast-paced environment.
Desired Qualifications and Competencies:
  • Bachelors Degree or equivalent work experience, with at least 7 years of application development experience required.
  • Experience with Java required. Desired areas of expertise include
    • Java EE 6
    • Apache Solr/Lucene
    • JMS
    • JPA/Hibernate
    • GlassFish 3
    • JSF
    • EJB 3.1
  • Experience in creation and maintenance of enterprise-grade application architecture, including SOA and messaging systems is required
  • Experience in SQL language and database technologies required.
  • Application of OO principles and use of best practices in web development required, with a strong background in application architecture.
  • ColdFusion MX experience desired, with experience using application frameworks and ColdFusion components.
  • Exposure to Adobe Flex 3 applications desired.
  • Competent in use of HTML, XML, CSS, and AJAX technologies.
  • Experience working in an Agile Scrum environment is desired.
  • Proficient in use of source control, defect management, and release management tools.
  • Consistently demonstrates strong team and individual performance.
  • Effective written and oral communication skills as well as strong interpersonal skills are essential.
  • Builds positive and effective relationships with individuals both internal and external to the organization.
  • Staffing/HR industry knowledge a plus.

Jobs2Web is an entrepreneurial employer that challenges and rewards all employees to succeed at every opportunity! Your talents are fully utilized as we are building this rapidly growing business. Our competitive market driven package includes a total rewards package of competitive pay, bonus, health insurance coverage, 401(k), career development, a very exciting marketplace and a really great work culture.

Nearest Major Market: Minneapolis
Job Segments: Architecture, ColdFusion, Computer, Creative, Database, Developer, Engineer, Engineering, Information Technology, Interactive Marketing, Java, Legal, Marketing, Patent, Product Development, Programmer, QA, Quality, Quality Assurance, Research, SEO, SQL, Technology, Web Design, XML

Wednesday, November 3, 2010

mxUnit Testing with Hudson CI Server @ CFUG Minneapolis

I'll be speaking Wednesday Nov 3, 2010 @ the ColdFusion User Group in St. Paul/Minneapolis on mxUnit Testing with Hudson Continuous Integration Server.

I'll be talking about basic Assertions, as well as going into some advanced mocking topics with the new 2.x release of the mxUnit Framework.
The second part of the evening we'll look at the Hudson Server to help execute our Unit Tests and provide jUnit reports that show execution trends as well as some special surprises.

See you there!

Wednesday, August 25, 2010

JDBC Connection String and Unicode

So we have a SQL Server 2005 JDBC Driver in production using the type 4 driver from Microsoft (Not the DataDirect Driver that ships with ColdFusion 8 Enterprise) and have it configured using the JDBC URL to specify the Host and some other parameters.  You do this by going into your ColdFusion Administrator and under Data & Services - Data Sources - Entering in a new connection specifying a Name and choosing 'Other' as the Driver:
Format: 


jdbc:sqlserver://xxx.xxx.xxx.xxxx;databaseName=MyDatabase;applicationName=Myclient;responseBuffering=adaptive;loginTimeout=5;lockTimeout=60000




Now the problem was that we had some other 'Connection String' information under the 'Advanced Settings' for this connection that we had configured to turn Unicode characters OFF for this dsn (thus using asii characters and varchar vs. unicode and nvarchar).  This was for performance as we had varchar fields on columns, and when we use cfquery param, and cf_sql_varchar, the dsn connection setting drives whether you are sending 'varchar(8000)' (non-unicode) or a' nvarchar(4000)' parameter to the database.


Database Indexes: If your index has to convert this nvarchar type to a varchar type of the column, then it will more than likely skip using the index all together and you loose the benefit of having an index on that column in your database (i.e. an email address field).


With Profiling ON we were able to watch the requests come through by manipulating the jdbc URL connection string as follows:
sendStringParametersAsUnicode=false will send the cfquery param data through as a varchar(8000) field
sendStringParametersAsUnicode =true (which is the default) will send it through as a nvarchar(4000) field




What we noticed is that those types of queries with:
<cfqueryparam value="#arguments.email#" cfsqltype="cf_sql_varchar">
would not use the index.


Another thing we noticed was that we had specified sendStringParametersAsUnicode=false in the 'Connection String' area under Advanced Settings.  This was NOT being taken into effect when sending parameterized queries to the db.  We HAD to move this string into the JDBC URL portion in order for it to work.  Bug in ColdFusion?? We're not sure, but we hope this helps someone out there.


This is how the dsn should look:









Friday, February 19, 2010

Executing Remote MXUnit Tests in CFBuilder/CFEclipse

I had some interesting problems the other week while working on some Model-Glue (gesture) RemoteService requests. I had posted to the Model-Glue Google Group about a few things I ran into when using the AbstractRemotingService.cfc, and getting url variables to work properly through the service, which they have addressed (Thank you!).

Obviously you need to read the wiki documentation first.

When you Create your RemoteService.cfc that exists at the root of your application, which will be your remoting front controller if you will, you need to tell it where your main model-glue template file is located. (download the zip file from www.model-glue.com and find the modelglueapplicationtemplate directory for the sample RemotingService.cfc)

Once you have a simple working version up / running by calling /RemotingService.cfc?method=executeEvent&event=my.event&format=json and pass in the data you need to, then you need a good way to test it right? If you use MXUnit then you have more than likely configured your IDE to execute these tests.

Figure 1.0


ISSUE:
The thing I ran into was that I was using model-glue's event security where I could specify certain events to be 'authentication' needed etc. My remoting service was calling an event that required prior authorization (i.e. session.isLoggedin() or some other means). Now, when I executed a test for this event in mxUnit through the Eclipse plugin for mxunit, it would Fail the test and kept telling me I was unauthorized to execute this event etc, and return the source code for my login screen instead (which would be correct if I was not logged in). However in my unit Test, I was making sure to Call my AuthorizationFacade and log me in in the 'setup' method and verified that 'isLoggedIn()' returned true.

RESOLUTION:
So in my unit test I am doing a cfhttp 'post' (or now that they supported url variables better in the service a 'get' ) request to the RemoteService.cfc passing in my data. HOWEVER, I needed to also pass in the following through my cfhttp call:


<cfhttpparam ....="formfield" name="CFIDE" value="#cookie.CFIDE#">
<cfhttpparam ....="formfield" name="CFTOKEN" value="#cookie.CFTOKEN#">
<cfhttpparam ....="formfield" name="JSESSIONID" value="#session.sessionid#">

Once this was in place, the calls worked as expected, and returned proper json data.