Tuesday, February 19, 2013
Apache ActiveMQ is a complete message broker and full JMS 1.1 provider featuring clustering, distributed destinations and XA support with pluggable persistence (JDBC, BDB, JDBM) and transport layers (TCP, UDP, multicast, NIO, SSL, Zeroconf, JXTA, JGroups).
This installation was done on Ubuntu x64, may be different for other Linux distributions.
The instructions will vary a little depending on system architecture (32 or 64 bit)
If you haven’t done so already download ActiveMQ from here
extract the download to a directory of your choice. I placed mine in /usr/local.
The rest of the guide will assume it’s in /usr/local, the full path of my installation is /usr/local/apache-activemq-5.5.0
Open activemq and set ACTIVEMQ_HOME to point to your installation directory
$ sudo vi /usr/local/apache-activemq-5.5.0/bin/linux-x86-64/activemq
Save activemq and open wrapper.conf, change set.default.ACTIVEMQ_HOME and set.default.ACTIVEMQ_BASE to point to your installation directory
$ sudo vi /usr/local/apache-activemq-5.5.0/bin/linux-x86-64/wrapper.conf
Save wrapper.conf and create a soft link in init.d
$ sudo ln -s /usr/local/apache-activemq-5.5.0/bin/linux-x86-64/activemq /etc/init.d/activemq
$ sudo update-rc.d activemq \ [hit_enter] start 66 2 3 4 5 . stop 34 0 1 6 .
And you’re done.
Start or stop the service manually
$ service activemq start $ service activemq stop
Check if ActiveMQ is running
$ service activemq status
Uninstalling the service
$ sudo update-rc.d -f activemq remove $ sudo rm /etc/init.d/activemq
Wednesday, August 17, 2011
Notice how you have to enable the service broker per database. Here is the class used to register to receive query notifications:
Here is the main class. Run a couple of them. The idea of this little toy program is to dispatch a task to exactly one process. The process gets the change notification and then tries to claim the top item in the queue by trying to insert it into another table. Because SQL enforces primary key uniqueness, exactly one process can successfully insert it. That’s how this toy program decides if it successfully got a queue item.
Sunday, April 10, 2011
I’m going to be starting a new project. The task--create a website for a photographer. I think ordinarily if it were just going to be static content, I would throw up a CMS of some kind and be done with it, but it’s just not that simple—never is. There are a couple custom things that have to take place.
One, there needs to be some kind of public photo gallery so that the photographer can show off different categories of photos. This gallery needs to take any kind of photo, watermark it and compress it. Preferably it needs to allow for a zip file of photos to be uploaded all at once. As a side note, I’m really surprised that browsers haven’t made multiple file uploading easier by now. But, I digress. This gallery also needs to be able to easily share things on social networks.
Two, there needs to be a restricted area where clients can login and choose which photos they would like in their packages after a photo shoot. Consequently, there needs to be an easy way for the photographer to create and upload these packages for pictures. As mentioned before, these photos also need to be watermarked and compressed.
Three, there is going to be static content so there needs to be an easy developer’s-hands-off way to manage that.
I think that covers the highlights. So let me talk about ideas and technologies I’m throwing around in my head. First, a long time ago I used to be of the mind set that I would just write everything myself because it would be easier. I have since come to my senses and like integrating open source projects as much as I can into the final product. I figure why reinvent what someone else has already done and done well (most of the time). Second, I’m a Microsoft guy and would prefer a .NET based platform. That rules out any PHP based (I very much dislike that language anyway) projects, which is fine.
So let me start with the static content requirement. This problem has been solved over and over by content management systems (CMS). There are quite a few popular ones. In the .NET world, I’ve worked extensively with DotNetNuke. Almost all the websites that have to do with the BYU College of Life Sciences are running off an instance of DotNetNuke. DNN was a perfect fit because it could do everything we needed it to do right out of box without actually have to extend it or search out extensions ourselves, with a few little exceptions. Also, the user interaction seemed to be intuitive for non-technical users. As a result, Life Sciences hosts 40 – 50 websites in that CMS. My problem with DNN is that skinning and extending, although powerful, are cumbersome. It is hard to just do something simple, from a developer’s perspective. From a user perspective, the process of adding modules to a page and setting them up is a synch.
So that leads me to my next choice, that being Umbraco. So, I’m not very familiar with Umbraco, but from the tutorials I’ve watched and the time I’ve spent messing with it, I’m leaning towards using it because of how easy it is to extend. There is hardly any overhead to plug into the many available parts of Umbraco. There is also a fairly extensive web services API making things such as mobile, desktop and cloud app integration very easy. So, I think I’m going to use Umbraco as my main platform and extend it to take care of the other requirements.
As far as a public photo gallery, I’m debating between Flickr or Gallery Server Pro—Flickr because it is free, has good API’s and a copyright displayed on each image, GSP because I have complete control over how images get stored, how they get watermarked, etc. Flickr apparently can’t watermark pictures, which is problematic, but it does have great social networking support, which GSP does not. I’ve have to think about this one more.
The restricted area I’ve already consigned myself to write.
So that’s what I’m up against. Not too bad.
Tuesday, March 29, 2011
Tuesday, February 22, 2011