Posts tagged ‘msg’

MSG now accepts OpenID identities

MSG login page
New MSG login page

MSG will now accept OpenID Identity URLs to log in with. When you first log in with your OpenID identity you’ll be asked if you want to associate your OpenID with an existing MSG account, or you can create a new MSG account (without a password obviously!) .

As far as I’m aware MSG is the first instant messenger system to offer open registration and the ability to login with an OpenID identity (feel free to let me know if I’m wrong about this ;-) )

I also have an OpenID server up and running (at: http://openid.open.ac.uk) and anyone is free to sign up for an OpenID identity with it, but please bear in mind that this is still an experimental service (I’m still tinkering!)

Next steps are some more testing and then having a look at trying one of the PHP OpenID libraries running as a consumer (plus making this blog OpenID enabled…)

The Eighth ‘Open’

Earlier, Marc posted a story on KMi planet about the 7 opens in MSG, well, I’ve started to make that 8 ;-) as I’ve finally got round to spending a bit of time looking at OpenID.

I’d spent a little bit of time last week looking at the draft of the OpenID book, which explained all the processes well of how it all works, but I struggled a little with the actual example in chapter 5 (or was it 6?!) – following how the URLs & packets matched the workflow previously explained.

This evening, I installed the JanRain PHP OpenID library on my laptop, so I now have a (dummy) OpenID identity provider and consumer up and running on my laptop. The instructions were for setting up on *nix server, but runs fine (with few tweaks to the instructions) on Windows (XP with PHP5) too. What I’ve done is all pretty basic, and probably quite insecure as I’m not using SSL or a ‘proper’ random number generator – but will be good enough for playing with. I hope to be able to rewrite the server part into Java/JSP as that’s what we’re going to be running it on. Although it may seem a little odd just rewriting (esp. when Java libraries already exist for OpenID) but my thinking is that doing it myself should help a lot in my actual understanding of how it all works… possibly!

Importance of being indexed

We noticed the other day that the MySQL process on one of our MSG servers was using up far more resources that it should do. After a little investigation it turned out that the problem was due to one very slow running query. The query in question had around 200k records in one table joined to a table with approx 80k records. Running the same query against my test database (with 70k and 80k records in the tables) ran in about 0.2 secs, but with the increased no of records it could take up to 630 seconds (yes – over 10 minutes), so no wonder then MySQL process was going into overdrive.

There were indexes on each of the tables, but only through a compound primary key, but the columns used for the join in the 2 tables in question didn’t have their own index. As soon as I added an index on these columns the query started to run in a much more respectable time (<0.2 secs).

So the lesson for me is to check that indexes are created for any columns used for joins on tables which are going to get big!

On a side note, this was in the OpenFire database and I’m not keen on the fact that their database structure uses the username column (a varchar(64) field) as the primary key for the user, rather than a more usual integer value. I suspect that joining two large tables on a varchar type column rather than integer column contributed to the slow running of the query.

BTW… can anyone recommend any (free/open-source) tools for analysing the performance and use of the indexes on a MySQL database? There seem to be loads MySQL admin type tools around, many paid-for products, but hard to tell which are any good for what I’m looking to do. Really I guess I’m looking for the similar features as MS SQL Query Analyser provides! Update 26/11/07 – I’m looking for something which gives me information about the query execution plan (i.e. how MySQL will use the indexes etc in the construction of the query) rather than general db admin tools for simply executing queries.

Video/audio chat in MSG…

Ever since I started working on MSG we’ve been asked for extra functionality to be added, most notably group-chat and option to have audio/video chat. We’ve always tried to resist giving in to these requests – on the basis that other IM services already do these things so why reinvent them, also, it’s all open source so if you can add them if you want!

However we’ve kinda given in to one of these, the video/audio chat one, the reason being that it’s actually relatively little work – we already have a service (FlashMeeting) which provides this type of functionality – so just need to link the 2 together. Well, we’ve nearly got this finished so when you’re in a chat session, there’s a one click launch flashmeeting – which automatically books the meeting and gives you the link to it…. so far so good – and also dubiously solves the group chat issues, since flashmeeting is multi-user rather than 1-1 (in fact better at multi-user than 1-1)…. but then we realised that we’ll only be able to apply this solution to the OpenLearn server.

The FlashMeeting and MSG OpenLearn servers have the exact same user base and account ids/emails etc all match up – so it’s quite trivial, however we run into problems with our general FlashMeeting and MSG servers as they have different user bases and even different policies on who can get accounts on each server. FlashMeeting accounts are only created by the FM team (you can’t self register – well, not without an OU email address?), but MSG has (or rather, will very shortly have) the ability for anyone to register – so we can’t then automatically auto create accounts the FM server. I know there are ways we _could_ do this but too many variables and too much if.. else if.. else if.. else.. code for my liking ;-) Another case for us to seriously look into whether OpenID and oAuth can really help solve these types of problem for us.

There are other services that we could use (recently found MeBeam – or rather they found us) which offer free to use, no-registration multi-user chat/audio/video facilities. However, we’ve not finally decided on any of these yet… and any other suggestions for services we could link to gratefully received ;-)

Chat history

We’ve (finally!) got round to releasing the chat history function on the live OpenLearn server (more details).. so pleased we’ve now got that done :-)

Tomcat, MySQL and case sensitive tAblE nAmEs…

Having ‘fun’ this morning trying to figure out another little bug which I need to get fixed to get the chat history working properly on our MSG servers running on *nix. The problem is related to the case sensitivity of table names… we have the table (in MySQL) ‘jiveProperty’ and when I try to select from this table (using the given camel case tablename) from my java class in my servlet, I get the error that table ‘jiveproperty’ doesn’t exist (note the case).

However if I run the same code from a jsp it works fine… so it appears to me that something is turning the table name in my java class from camel case to all lower case, but this isn’t happening for my jsp pages – which are running from the same servlet container, so should be using the same mysql connector classes and settings.

any ideas???

Update (7/11)… problem turned out to be that when we overwrote the compiled classes in the servlet container and restarted tomcat, the tomcat work directory was still using the old version of the class. So before starting tomcat again we needed to clear out the work directory to make sure the new class was being used.

IE crashing with MSG

Came back from holiday yesterday (see the pics!) , to find a stack of emails about problems with MSG crashing IE. This is a bit odd as we’ve not updated MSG for a little while, so strange that it just seems to have started occuring. It seems quite an erratic problem, but it does bring the whole browser down – something I find a little odd for a purely javascript application.

I’m really hoping to get this fixed very soon, but haven’t yet found the root cause, I can reliable recreate the issue, so just need to find why it’s happening.

Plus I need to get my presentation for next weeks OpenLearn conference written sometime soon!

Update (29th Oct)… I have now got the problem resolved, though still don’t know the real root cause. I fixed it by going back through the changes I’ve made recently and seeing at what point the error started occuring.
The change which appears to have been causing the error was when I switched from using <a href=”javascript:….”> to using (what I thought was the proper way!) of adding/removing event listeners. The actual problem occured with the call to detach event, although it didn’t fail everytime – it would work for the first few times and then randomly cause the browser to crash. I did notice that the carsh would only happen if I had the MSG client and the referring site (the one with the users presence icon) open at the same time, if only one was open the crash wouldn’t occur.

For info this was the code that was causing problems:

var oldImg = presenceNode.firstChild;
//remove any current listeners
if(oldImg.removeEventListener){ // Mozilla, Netscape, Firefox
oldImg.removeEventListener('click', launchClick, false);
oldImg.removeEventListener('click', readMessageClick, false);
} else { // IE
oldImg.detachEvent('onclick', launchClick);
oldImg.detachEvent('onclick', readMessageClick);
}

So I replaced this with the code below that just alters the location and title of the link (also a bit of adjusting to add the <a> in):

var oldAnchor = presenceNode.firstChild;
var newAnchor = oldAnchor.cloneNode(true);
newAnchor.href = "javascript:readMessageClick();";
newAnchor.title = MSGAPIconf.str_oneMessageUnread;


So, glad to have got it fixed, but would be even better to know why this was really happening at all!

Update Number 2 (1st Nov) – The fix has now been made live on the MSG-OpenLearn servers.

Voice and multi-user chat (via FlashMeeting integration)

I’ve now started work on being able to launch an instant FlashMeeting when you are using MSG. This would enable users to start up video & voice capabilities directly from MSG, rather than having to visit the FlashMeeting site seperately and book a meeting. It would also be a workaround for (all) those who want voice chat and multi-user chat as you could just instantly fire up FlashMeeting to get these capabilities. Most of the structure is now in place, we just need to get a service built which would book the FlashMeeting (behind the scenes) and check the FM server has capacity etc. Hopefully we should be able to get this implemented soon ;-)

MSG Netvibes widget update

I’ve just updated the MSG Netvibes widget to include a link to the MSG Presence maps page so you can launch the map without having to go through the MSG client first.

No more ‘lost’ MSG messages

I’ve now implemented the chat history function on the msg.open.ac.uk server, so we can try it out there for little while, before I transfer it over to the msg-openlearn server.

I have found a couple of little ‘quirks’ which I’m not sure will annoy users or not…

  1. the chat history is only written to the log files every 120 seconds (or whatever no of secs I set it to), presumably to stop too many file read/writes which would have performance implications. But it means that if you have a conversation, close the window, then immediately re-open a chat with the same user and try to load the history, you may not see the message history from the last couple of minutes (the history will be there later, just not now). I don’t know that I can completely resolve this, but I have set the log files to be written every 30 seconds, so hopefully it won’t be an issue.
  2. another thing that may look a bit odd is that if you have a chat with someone for a little while, and then decide to load the history, the messages from over 2 mins ago will appear twice. I don’t want to just overwrite the whole chat window, because then you won’t get the most recent messages (due to (1)), and I guess seeing the message twice is better than not at all. I think I’ve got a way around this, and that is to load mark the “loaded chat history” in the interface, so you know what is currently stored – and it then won’t look so odd that some messages appear twice.

Any feedback on the new chat history function is much appreciated :-)