When users upload a multimedia file to Toti S.'s company's website, their system transcodes the file into several different multimedia formats. At the high level, it's a pretty basic process.

1. User uploads file to Upload Server
2. Upload Server notified Transcoding Server via an XML request
3. Transcoding Server reads XML request and does its thing (creating various sizes/flavors of multimedia content)
4. Transcoding Server uploads various files to the Main Server

However, it was continuously hanging or breaking, which meant that someone (usually a developer) would have to go in and manually transcode then upload the files. So, Toti's team went code exploring and found this in the file upload servlet:

 

logger.info("Notify transcoder");
notifyTranscoder(faceIndex, gpID, contentType, location);

It seemed like a logical thing to do, until they found the notifyTranscoder action...

 

private void notifyTranscoder(Integer faceIndex, Integer ghettoPartID, 
                              String contentType, String location)
{
  // Build XML Request
  TranscodingRequestXML transRequest = new TranscodingRequestXML();
  transRequest.setFaceIndex(faceIndex);
  transRequest.setGhettoPartID(ghettoPartID);
  transRequest.setContentType(contentType);
  transRequest.setLocation(location);
  String transXML = transRequest.toXML();

  // Build EMail body
  MimeMultipart mp = new MimeMultipart();
  MimeBodyPart bp = new MimeBodyPart();
  bp.setText(transXML, "UTF-8");
  bp.setHeader("Content-Type", "text/xml; charset=UTF-8");
  mp.addBodyPart(bp);

  // Create MIME message
  MimeMessage msg = new MimeMessage( loadMailSession() );
  msg.setContent(mp);
  msg.saveChanges();

  // Send the message
  String transcoderEmailAddress = settings.getValue("transcoderemailaddress");
  DeliveryAgent delivery = new DeliveryAgent();
  delivery.setRecipientAddress(transcoderEmailAddress);
  delivery.setDeliveryMode(true);
  delivery.deliver(msg);
}

In case you missed that, the Upload Server sent its requests to the Transcoding Server via email. I guess Toti is lucky that the original developers didn't have access to fax and OCR.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!